Message278405
Nick, I think you've missed the "undefined" encoding that we've had for this ever since Unicode was added to Python.
You put the needed code into your sitecustomize.py file and Python2 will then behave just like Python3, i.e. raise an exception instead of coercing to Unicode:
sitecustomize.py:
import sys
sys.setdefaultencoding('undefined')
There's no need to hack this into site.py or to make sys.setdefaultencoding() available outside sitecustomize.py.
If you want an OS environ switch, you can put the necessary logic into sitecustomize.py as well. |
|
Date |
User |
Action |
Args |
2016-10-10 07:17:34 | lemburg | set | recipients:
+ lemburg, ncoghlan |
2016-10-10 07:17:34 | lemburg | set | messageid: <1476083854.55.0.140774997651.issue28403@psf.upfronthosting.co.za> |
2016-10-10 07:17:34 | lemburg | link | issue28403 messages |
2016-10-10 07:17:34 | lemburg | create | |
|