commit 8f58bbf38f5984e70d6e0be7427deb99d7782d1d
Author: Kevin Benton <email address hidden>
Date: Tue Oct 6 20:16:15 2015 -0700
Fixed multiple py34 gate issues
1. Scope mock of 'open' to module
By mocking 'open' at the module level, we can avoid affecting
'open' calls from other modules.
2. Stop using LOG.exception in contexts with no sys.exc_info set
Python 3.4 logger fills in record.exc_info with sys.exc_info() result
[1], and then it uses it to determine the current exception [2] to
append to the log message. Since there is no exception, exc_info[1] is
None, and we get AttributeError inside traceback module.
It's actually a bug in Python interpreter that it attempt to access the
attribute when there is no exception. It turns out that it's fixed in
latest master of cPython [3] (the intent of the patch does not seem
relevant, but it removes the offending code while reshuffling the code).
Note that now cPython correctly checks the exception value before
accessing its attributes [4].
The patch in cPython that resulted in the failure is [5] and is present
since initial Python 3k releases.
Reviewed: https:/ /review. openstack. org/232265 /git.openstack. org/cgit/ openstack/ neutron/ commit/ ?id=8f58bbf38f5 984e70d6e0be742 7deb99d7782d1d
Committed: https:/
Submitter: Jenkins
Branch: master
commit 8f58bbf38f5984e 70d6e0be7427deb 99d7782d1d
Author: Kevin Benton <email address hidden>
Date: Tue Oct 6 20:16:15 2015 -0700
Fixed multiple py34 gate issues
1. Scope mock of 'open' to module
By mocking 'open' at the module level, we can avoid affecting
'open' calls from other modules.
2. Stop using LOG.exception in contexts with no sys.exc_info set
Python 3.4 logger fills in record.exc_info with sys.exc_info() result
[1], and then it uses it to determine the current exception [2] to
append to the log message. Since there is no exception, exc_info[1] is
None, and we get AttributeError inside traceback module.
It's actually a bug in Python interpreter that it attempt to access the
attribute when there is no exception. It turns out that it's fixed in
latest master of cPython [3] (the intent of the patch does not seem
relevant, but it removes the offending code while reshuffling the code).
Note that now cPython correctly checks the exception value before
accessing its attributes [4].
The patch in cPython that resulted in the failure is [5] and is present
since initial Python 3k releases.
The patch in fixtures that broke us is [6].
[1]: https:/ /hg.python. org/cpython/ file/tip/ Lib/logging/ __init_ _.py#l1412 /hg.python. org/cpython/ file/tip/ Lib/logging/ __init_ _.py#l575 /hg.python. org/cpython/ rev/73afda5a4e4 c /hg.python. org/cpython/ rev/73afda5a4e4 c#l6.484 /hg.python. org/cpython/ rev/2ee09afee12 6 /github. com/testing- cabal/fixtures/ commit/ 67dd2956943261e 845a866dab15520 8c51da937e
[2]: https:/
[3]: https:/
[4]: https:/
[5]: https:/
[6]: https:/
Closes-Bug: #1503847 4d3f8c91583685e 0e1eaa84719
Closes-Bug: #1504053
Co-Authored-By: Ihar Hrachyshka <email address hidden>
Change-Id: I456b7846b8a53e