Skip to content

Fix Flask integration AttributeError on Python 2#111

Merged
SergeyKanzhelev merged 1 commit intomicrosoft:developfrom
c-w:fix-traceback-py2
Jul 10, 2018
Merged

Fix Flask integration AttributeError on Python 2#111
SergeyKanzhelev merged 1 commit intomicrosoft:developfrom
c-w:fix-traceback-py2

Conversation

@c-w
Copy link
Contributor

@c-w c-w commented Jul 3, 2018

The __traceback__ attribute for exceptions was only introduced in
Python 3 so the current way of sending exception information to
Application Insights from Flask fails in Python 2. This change fixes
that by re-raising the exception and using sys.exc_info under the hood
to gather the exception information.

@SergeyKanzhelev
Copy link
Contributor

@c-w can you please add a note in CHANGELOG as well?

The `__traceback__` attribute for exceptions was only introduced in
Python 3 so the current way of sending exception information to
Application Insights from Flask fails in Python 2. This change fixes
that by re-raising the exception and using `sys.exc_info` under the hood
to gather the exception information.
@c-w
Copy link
Contributor Author

c-w commented Jul 5, 2018

Thanks for the review @SergeyKanzhelev. Updated the change-log in 6e37159.

@c-w
Copy link
Contributor Author

c-w commented Jul 10, 2018

Hi @SergeyKanzhelev, just checking in on this again. Is there anything else that you need me to do on this PR?

@SergeyKanzhelev
Copy link
Contributor

Sorry. Lost track of notifications after 4th of July vacation. Merging now. Thanks again!

@SergeyKanzhelev SergeyKanzhelev merged commit d089503 into microsoft:develop Jul 10, 2018
@c-w c-w deleted the fix-traceback-py2 branch July 10, 2018 16:40
@c-w
Copy link
Contributor Author

c-w commented Jul 10, 2018

Thanks for the merge!

@SergeyKanzhelev
Copy link
Contributor

I'll wait till releasing the new version. There is a new issue about the logger and dictConfig that looks to be blocking somebody. It would be great if these two issues can be shipped at once.

If you need new version now - let me know

@c-w
Copy link
Contributor Author

c-w commented Jul 10, 2018

Sure thing, no worries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants