[SRU] Backport python3.4 logging module backward incompatibility fix.
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Python |
Fix Released
|
Unknown
|
|||
python3.4 (Ubuntu) |
Fix Released
|
High
|
Unassigned | ||
Trusty |
Triaged
|
High
|
Unassigned | ||
Utopic |
Fix Released
|
High
|
Unassigned |
Bug Description
Python 3.4 released with a backward incompatible change in the logging module. This bug has been tracked and fixed
upstream in http://
would return an integer value for a string lvl and a string value for an integer lvl.
It mapped the two representations of log levels to each other. This behavior existed
in python2.6 through python3.3 but was removed in 3.4. The new behavior in 3.4 was to
only map integer lvl values to strings.
[Impact]
Any python code that aims to be compatible with python2.6 and python3.4 must carry its
own log level mappings (which may change under it because the loglevels are extensible)
or access private data within the python logging module. Both approaches are fragile
but thankfully upstream python 3.4 has patched this behavior so a downstream update
to Trusty python3.4 would allow code to easily support 2.6 and 3.4.
[Test Case]
As detailed in the upstream bug you can test this easily via the interactive interpreter.
Desired Behavior:
>>> logging.
20
>>> logging.
'INFO'
>>>
Current Trusty Behavior:
# This function call should return 20.
>>> logging.
'Level INFO'
>>> logging.
'INFO'
>>> logging.
'INFO'
>>>
[Regression Potential]
The upstream patch is tiny and comes with a test case to track the desired behavior
(upstream already had tests for the other behavior of this function). Beacuse this
patch is so small and comes with new tests I think the regression potential is very
small. Probably the only thing to consider is that new python3.4 code may have come
to rely on this new backward incompatible behavior. But that would only be the case
if code specifically looked for the mapping of 'Level %s' % 'stringlevelhere'.
Related branches
summary: |
- Backport python3.4 logging module backward incompatibility fix. + [SRU] Backport python3.4 logging module backward incompatibility fix. |
Changed in python3.4 (Ubuntu Trusty): | |
assignee: | nobody → Clint Byrum (clint-fewbar) |
status: | Triaged → In Progress |
Changed in python: | |
status: | Unknown → Fix Released |
I should also note that https:/ /hg.python. org/cpython/ rev/a4c5effb869 8 is where the upstream bug was fixed.