This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author jaraco
Recipients amaury.forgeotdarc, jaraco, weirdink13
Date 2012-06-06.16:53:17
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1339001599.14.0.552137942368.issue14847@psf.upfronthosting.co.za>
In-reply-to
Content
I find that on Python 2.7.3 64-bit Windows, the deletion of locale.encodings is also necessary:

PS C:\Users\jaraco> python
Python 2.7.3 (default, Apr 10 2012, 23:24:47) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> b'x'.decode('utf-8')
u'x'
>>> del sys.modules['encodings.utf_8'], sys.modules['encodings']
>>> b'x'.decode('utf-8')
u'x'
>>> ^Z

PS C:\Users\jaraco> python
Python 2.7.3 (default, Apr 10 2012, 23:24:47) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> b'x'.decode('utf-8')
u'x'
>>> import locale; del locale.encodings   # Not necessary with python2
>>> del sys.modules['encodings.utf_8'], sys.modules['encodings']
>>> b'x'.decode('utf-8')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "c:\python\lib\encodings\utf_8.py", line 16, in decode
    return codecs.utf_8_decode(input, errors, True)
AttributeError: 'NoneType' object has no attribute 'utf_8_decode'
History
Date User Action Args
2012-06-06 16:53:19jaracosetrecipients: + jaraco, amaury.forgeotdarc, weirdink13
2012-06-06 16:53:19jaracosetmessageid: <1339001599.14.0.552137942368.issue14847@psf.upfronthosting.co.za>
2012-06-06 16:53:18jaracolinkissue14847 messages
2012-06-06 16:53:17jaracocreate