[issue18109] os.uname() crashes if hostname contains non-ascii characters

Dmi Baranov report at bugs.python.org
Mon Jun 3 07:47:37 CEST 2013


Dmi Baranov added the comment:

Thanks Charles - I'm reproduced Dominik's issue at default branch:

$ python -c 'import os, sys;print(sys.version);print(os.uname())' 
3.4.0a0 (default:adfec512fb32, Jun  3 2013, 08:09:43) 
[GCC 4.6.3]
Traceback (most recent call last):
  File "<string>", line 1, in <module>
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1: ordinal not in range(128)

Lastest branches affected only, so - this a bug.

$ python -c 'import os, sys;print(sys.version);print(os.uname())'
2.7.5+ (2.7:e9d0fb934b46, Jun  3 2013, 08:05:55) 
[GCC 4.6.3]
('Linux', 'h\xc3\xa2t', '3.2.0-32-generic', '#51-Ubuntu SMP Wed Sep 26 21:32:50 UTC 2012', 'i686')

$ python -c 'import os, sys;print(sys.version);print(os.uname())'
3.2.5 (3.2:b9b521efeba3, Jun  3 2013, 08:24:06) 
[GCC 4.6.3]
('Linux', 'hât', '3.2.0-32-generic', '#51-Ubuntu SMP Wed Sep 26 21:32:50 UTC 2012', 'i686')

Env:
$ hostname
hât
$ locale
LANG=en_US.UTF-8
...

BTW, that issue do not allow to compile from sources on hosts with similar names, I've created separate issue #18124 (possible a duplicate, but another behavior)

----------
components: +Library (Lib)
type: crash -> behavior
versions: +Python 3.4

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue18109>
_______________________________________


More information about the Python-bugs-list mailing list