[pypy-issue] Issue #3124: pypy3 fails to print non-ascii characters with `LANG=` (pypy/pypy)

Antonio Cuni issues-reply at bitbucket.org
Thu Nov 28 10:00:34 EST 2019


New issue 3124: pypy3 fails to print non-ascii characters with `LANG=`
https://bitbucket.org/pypy/pypy/issues/3124/pypy3-fails-to-print-non-ascii-characters

Antonio Cuni:

`bug.py`

```python
#-*- encoding: utf-8 -*-

import sys
sys.stdout.write('hellò\n')
```

```
$ LANG= python3 /tmp/bug.py 
hellò

$ LANG= pypy3 -E /tmp/bug.py 
Traceback (most recent call last):
  File "/tmp/bug.py", line 4, in <module>
    sys.stdout.write('hell\xf2\n')
  File "/home/antocuni/pypy/release/py3k/latest/lib-python/3/encodings/ascii.py", line 22, in encode
    return codecs.ascii_encode(input, self.errors)[0]
UnicodeEncodeError: 'ascii' codec can't encode character '\xf2' in position 4: ordinal not in range(128)
```

\(PyPy3 7.2.0, CPython 3.7\)




More information about the pypy-issue mailing list