[issue18109] os.uname() crashes if hostname contains non-ascii characters
New submission from Dominik Richter: To reproduce (tested on Arch Linux, python 3.3.2): sudo hostname hât python -c "import os; os.uname()" produces: Traceback (most recent call last): File "", line 1, in UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1: ordinal not in range(128) -- components: Unicode messages: 190413 nosy: Dominik.Richter, ezio.melotti priority: normal severity: normal status: open title: os.uname() crashes if hostname contains non-ascii characters type: crash versions: Python 3.3 ___ Python tracker <http://bugs.python.org/issue18109> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18109] os.uname() crashes if hostname contains non-ascii characters
Dominik Richter added the comment: @dmi.baranov: You're right, according to: http://tools.ietf.org/html/rfc952 ::= *["."] ::= [*[]] http://tools.ietf.org/html/rfc1178 Don't use non-alphanumeric characters in a name. If you use posix definition of alphanumeric, that fits. What a shame ;) -- resolution: -> invalid type: behavior -> crash ___ Python tracker <http://bugs.python.org/issue18109> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18109] os.uname() crashes if hostname contains non-ascii characters
Dominik Richter added the comment: @haypo: You're right, RFC1178 is only a recommendation. RFC952 however is mandatory, although it doesn't seem to define explicitly (or at least i wasn't able to find it; thus referencing POSIX). Regarding Arch Linux's hostname: It is part of the package inetutils v1.9.1-5 [1], which is GNU inetutils packaged [2]. Unfortunately I don't know which encoding it uses. I agree with you: It would be great if python supported it. fyi: I opened a bug on Arch Linux [3] (thank you Dmi for the suggestion) [1] https://www.archlinux.org/packages/core/i686/inetutils/ [2] http://www.gnu.org/software/inetutils/ [3] https://bugs.archlinux.org/task/35580 -- ___ Python tracker <http://bugs.python.org/issue18109> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18109] os.uname() crashes if hostname contains non-ascii characters
Dominik Richter added the comment: @neologix: (with current hostname showing at the left of my prompt) none:~ #> echo hât > /proc/sys/kernel/hostname hât:~ #> hostname hât -- ___ Python tracker <http://bugs.python.org/issue18109> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18109] os.uname() crashes if hostname contains non-ascii characters
Dominik Richter added the comment: /off: nevermind, wasn't directed at me -- ___ Python tracker <http://bugs.python.org/issue18109> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18109] os.uname() crashes if hostname contains non-ascii characters
Dominik Richter added the comment: Thank you all for your help, works great! @Victor: fully agree on the ascii hostname ;) -- ___ Python tracker <http://bugs.python.org/issue18109> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com