Fix Flask integration AttributeError on Python 2#111
Merged
SergeyKanzhelev merged 1 commit intomicrosoft:developfrom Jul 10, 2018
c-w:fix-traceback-py2
Merged
Fix Flask integration AttributeError on Python 2#111SergeyKanzhelev merged 1 commit intomicrosoft:developfrom c-w:fix-traceback-py2
SergeyKanzhelev merged 1 commit intomicrosoft:developfrom
c-w:fix-traceback-py2
Conversation
SergeyKanzhelev
approved these changes
Jul 5, 2018
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.
Contributor
Author
|
Thanks for the review @SergeyKanzhelev. Updated the change-log in 6e37159. |
Contributor
Author
|
Hi @SergeyKanzhelev, just checking in on this again. Is there anything else that you need me to do on this PR? |
Contributor
|
Sorry. Lost track of notifications after 4th of July vacation. Merging now. Thanks again! |
Contributor
Author
|
Thanks for the merge! |
Contributor
|
I'll wait till releasing the new version. There is a new issue about the logger and If you need new version now - let me know |
Contributor
Author
|
Sure thing, no worries. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
__traceback__attribute for exceptions was only introduced inPython 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_infounder the hoodto gather the exception information.