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

2013-06-03 Thread Dominik Richter
Dominik Richter added the comment: Thank you all for your help, works great! @Victor: fully agree on the ascii hostname ;) -- ___ Python tracker ___ _

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

2013-06-03 Thread STINNER Victor
STINNER Victor added the comment: Oh, by the way, I also changed socket.gethostname(). -- ___ Python tracker ___ ___ Python-bugs-list

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

2013-06-03 Thread STINNER Victor
STINNER Victor added the comment: test_logging is failing with a non-ASCII hostname because of the following error: error: uncaptured python exception, closing channel (:'ascii' codec can't encode character '\xe9' in position 6: ordinal not in range(128) [/home/haypo/prog/python/default/Li

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

2013-06-03 Thread STINNER Victor
STINNER Victor added the comment: issue18109.patch is not correct: it uses the locale encoding in strict mode, the surrogateescape error handler should be used instead. I rewrote the patch. I removed the unit test because changing a hostname is really unexpected and may break (crash?) running

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

2013-06-03 Thread Roundup Robot
Roundup Robot added the comment: New changeset ffdee6b36305 by Victor Stinner in branch '3.3': Close #18109: os.uname() now decodes fields from the locale encoding, and http://hg.python.org/cpython/rev/ffdee6b36305 New changeset 2472603af83e by Victor Stinner in branch 'default': (Merge 3.3) Clo

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

2013-06-03 Thread Dmi Baranov
Dmi Baranov added the comment: There is patch. Test is non-LGTM, because having a side effect for hostname and requires root's permissions for manipulations with hostname[*]. Someone having ideas how I can "mock" system `uname` call? [*] But this way is OK for Lib/test/test_sockets.py. I'm ove

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

2013-06-02 Thread Dmi Baranov
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 "", line 1, in Unicod

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

2013-06-01 Thread Dominik Richter
Dominik Richter added the comment: /off: nevermind, wasn't directed at me -- ___ Python tracker ___ ___ Python-bugs-list mailing list

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

2013-06-01 Thread Dominik Richter
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 ___

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

2013-06-01 Thread Charles-François Natali
Charles-François Natali added the comment: To reproduce the issue, try this: # echo > /proc/sys/kernel/hostname > the locale encoding + surrogateescape error handler Sounds reasonable. -- nosy: +neologix ___ Python tracker

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

2013-05-31 Thread R. David Murray
R. David Murray added the comment: Issue 10097 may also have some relevant discussion, even though that issue originates from Windows. -- nosy: +r.david.murray ___ Python tracker __

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

2013-05-31 Thread Dominik Richter
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 inet

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

2013-05-31 Thread STINNER Victor
STINNER Victor added the comment: """ http://tools.ietf.org/html/rfc1178 Don't use non-alphanumeric characters in a name. """ This is a recommendation, it does not mean that it is forbidden. But on Fedora, I'm unable to set a non-ASCII hostname. Arch Linux may be different. Python should not

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

2013-05-31 Thread Dominik Richter
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 ;)

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

2013-05-31 Thread Dmi Baranov
Dmi Baranov added the comment: /offtop Dumn, sorry for duplication here, Victor. We not having websockets here, my page not refreshed. -- ___ Python tracker ___

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

2013-05-31 Thread Dmi Baranov
Dmi Baranov added the comment: I just checked RFC952 [1] and RFC1123 [2], that host name is incorrect. I think, you need report to Arch Linux bug-tracker. $ sudo hostname hât hostname: the specified hostname is invalid $ uname -a Linux d9frog9n-desktop 3.2.0-32-generic #51-Ubuntu SMP Wed Sep 26

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

2013-05-31 Thread STINNER Victor
STINNER Victor added the comment: See also issue #9377 (similar issue with the socket module). -- ___ Python tracker ___ ___ Python-bu

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

2013-05-31 Thread STINNER Victor
STINNER Victor added the comment: I'm unable to set an non-ASCII hostname on Fedora 18 (Linux kernel 3.9.2): $ sudo hostname hât hostname: the specified hostname is invalid -- nosy: +haypo ___ Python tracker _

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

2013-05-31 Thread Charles-François Natali
Changes by Charles-François Natali : -- type: crash -> behavior ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

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

2013-05-31 Thread Dominik Richter
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: ord