Issue3772
Created on 2008-09-04 03:47 by mhammond, last changed 2008-09-04 07:32 by vsajip.
| File name |
Uploaded |
Description |
Edit |
Remove |
|
logging_encoding.patch
|
mhammond,
2008-09-04 03:49
|
A test case and fix. |
|
|
|
msg72478 - (view) |
Author: Mark Hammond (mhammond) |
Date: 2008-09-04 03:47 |
|
It appears r66103 introduced a regression - file objects are treated as
having an encoding, so non-ascii data fails. It was further complicated
by the fact that file objects in 2.6 have an 'encoding' attribute, but
by default it is None - so a 'hasattr' check for encoding doesn't work
the same.
The fix is quite trivial and I also added a new test to demonstrate the
error - but for the impatient, you can reproduce it via:
import logging
log = logging.getLogger("test")
log.addHandler(logging.FileHandler("log.out"))
log.warning("foo\x80")
In all earlier versions of Python, the bytes as specified are written.
2.6 complains that 'None' is not a valid encoding and fails to write the
record.
|
|
msg72486 - (view) |
Author: Vinay Sajip (vsajip) |
Date: 2008-09-04 07:32 |
|
Changes checked into trunk.
|
|
| Date |
User |
Action |
Args |
| 2008-09-04 07:32:13 | vsajip | set | status: open -> closed resolution: fixed messages:
+ msg72486 |
| 2008-09-04 03:49:08 | mhammond | set | files:
+ logging_encoding.patch |
| 2008-09-04 03:47:14 | mhammond | create | |
|