airflow-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF subversion and git services (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (AIRFLOW-1639) ValueError does not have .message attribute
Date Sun, 24 Sep 2017 19:37:02 GMT

    [ https://issues.apache.org/jira/browse/AIRFLOW-1639?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16178335#comment-16178335
] 

ASF subversion and git services commented on AIRFLOW-1639:
----------------------------------------------------------

Commit 87df670a4ed5b6b0a527972732a6f0c125490935 in incubator-airflow's branch refs/heads/v1-9-test
from [~Fokko]
[ https://git-wip-us.apache.org/repos/asf?p=incubator-airflow.git;h=87df670 ]

[AIRFLOW-1639] Fix Fernet error handling

When the encrypted string cannot be decryted using
Fernet for some
reason, an error will be thrown. In Python 3.6.2
the .message attr
is not available. By casting the ValueError to a
string, the message
will be extracted from the Error.

Closes #2629 from Fokko/AIRFLOW-1639-fix-error-
handling

(cherry picked from commit aedf8de61e21157ec671f9ed6ff511ee8898544f)
Signed-off-by: Bolke de Bruin <bolke@xs4all.nl>


> ValueError does not have .message attribute
> -------------------------------------------
>
>                 Key: AIRFLOW-1639
>                 URL: https://issues.apache.org/jira/browse/AIRFLOW-1639
>             Project: Apache Airflow
>          Issue Type: Bug
>            Reporter: Fokko Driesprong
>            Assignee: Fokko Driesprong
>             Fix For: 1.9.0
>
>
> Hi all,
> I would like to propose a small fix which I encountered when working on another PR:
> ```
> Traceback (most recent call last):
>   File "/usr/local/lib/python3.6/site-packages/flask_admin/contrib/sqla/view.py", line
1017, in create_model
>     form.populate_obj(model)
>   File "/usr/local/lib/python3.6/site-packages/wtforms/form.py", line 96, in populate_obj
>     field.populate_obj(obj, name)
>   File "/usr/local/lib/python3.6/site-packages/wtforms/fields/core.py", line 327, in
populate_obj
>     setattr(obj, name, self.data)
>   File "<string>", line 1, in __set__
>   File "/airflow/airflow/models.py", line 3929, in set_val
>     fernet = get_fernet()
>   File "/airflow/airflow/models.py", line 105, in get_fernet
>     .format(ve.message))
> AttributeError: 'Error' object has no attribute 'message'
> ```
> Cheers, Fokko



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message