[pypy-issue] [issue1508] PyPy 2.0 does not respect default encoding

kostia.lopuhin tracker at bugs.pypy.org
Sun Jun 2 11:14:37 CEST 2013


New submission from kostia.lopuhin <kostia.lopuhin at gmail.com>:

When default encoding is set to utf-8 via

import sys
sys.setdefaultencoding('utf-8')

CPython respects it

/usr/bin/python
Python 2.7.2 (default, Oct 11 2012, 20:14:37)
[GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)] on darwin
>>> import sys
>>> sys.getdefaultencoding()
'utf-8'
>>> 'fasd афыва %s' % u'афыва'
u'fasd \u0430\u0444\u044b\u0432\u0430 \u0430\u0444\u044b\u0432\u0430'

And PyPy (both OS X and Ubuntu) does not:

python
Python 2.7.3 (b9c3566aa017, May 09 2013, 15:27:31)
[PyPy 2.0.0 with GCC 4.2.1 Compatible Apple LLVM 4.2 (clang-425.0.27)] on darwin
>>>> import sys
>>>> sys.getdefaultencoding()
'utf-8'
>>>> 'fasd афыва %s' % u'афыва'
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
UnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in position 5: ordinal
not in range(128)

----------
messages: 5816
nosy: kostia.lopuhin, pypy-issue
priority: bug
release: 2.0
status: unread
title: PyPy 2.0 does not respect default encoding

________________________________________
PyPy bug tracker <tracker at bugs.pypy.org>
<https://bugs.pypy.org/issue1508>
________________________________________


More information about the pypy-issue mailing list