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=16178332#comment-16178332
] 

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

Commit aedf8de61e21157ec671f9ed6ff511ee8898544f in incubator-airflow's branch refs/heads/master
from [~Fokko]
[ https://git-wip-us.apache.org/repos/asf?p=incubator-airflow.git;h=aedf8de ]

[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


> 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