Skip to content
This repository has been archived by the owner. It is now read-only.

Fix Flask integration AttributeError on Python 2 #111

Merged
merged 1 commit into from Jul 10, 2018
Merged

Fix Flask integration AttributeError on Python 2 #111

merged 1 commit into from Jul 10, 2018

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

@SergeyKanzhelev SergeyKanzhelev commented Jul 5, 2018

@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 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 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

@SergeyKanzhelev SergeyKanzhelev commented Jul 10, 2018

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
2 checks passed
@c-w c-w deleted the fix-traceback-py2 branch Jul 10, 2018
@c-w
Copy link
Contributor Author

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

Thanks for the merge!

@SergeyKanzhelev
Copy link
Contributor

@SergeyKanzhelev SergeyKanzhelev commented Jul 10, 2018

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 c-w commented Jul 10, 2018

Sure thing, no worries.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants