[issue32370] Wrong ANSI encoding used by subprocess for some locales

2018-02-13 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32370] Wrong ANSI encoding used by subprocess for some locales

2018-02-13 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset c3f9d7e0ea30e94c901d13e1d43ff0be1e5dbcb7 by Serhiy Storchaka in 
branch '3.6':
[3.6] bpo-32370: Use the correct encoding for ipconfig output in the uuid 
module. (GH-5608). (#5654)
https://github.com/python/cpython/commit/c3f9d7e0ea30e94c901d13e1d43ff0be1e5dbcb7


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32370] Wrong ANSI encoding used by subprocess for some locales

2018-02-13 Thread miss-islington

miss-islington  added the comment:


New changeset 9b5a90b975ef32b261d60b8ec06504f4ffd00d63 by Miss Islington (bot) 
in branch '3.7':
bpo-32370: Use the correct encoding for ipconfig output in the uuid module. 
(GH-5608)
https://github.com/python/cpython/commit/9b5a90b975ef32b261d60b8ec06504f4ffd00d63


--
nosy: +miss-islington

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32370] Wrong ANSI encoding used by subprocess for some locales

2018-02-12 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
pull_requests: +5456

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32370] Wrong ANSI encoding used by subprocess for some locales

2018-02-12 Thread miss-islington

Change by miss-islington :


--
pull_requests: +5454

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32370] Wrong ANSI encoding used by subprocess for some locales

2018-02-12 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset da6c3da6c33c6bf794f741e348b9c6d86cc43ec5 by Serhiy Storchaka 
(Segev Finer) in branch 'master':
bpo-32370: Use the correct encoding for ipconfig output in the uuid module. 
(GH-5608)
https://github.com/python/cpython/commit/da6c3da6c33c6bf794f741e348b9c6d86cc43ec5


--
nosy: +serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32370] Wrong ANSI encoding used by subprocess for some locales

2018-02-11 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
versions: +Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32370] Wrong ANSI encoding used by subprocess for some locales

2018-02-10 Thread Steve Dower

Steve Dower  added the comment:

The patch looks good, but the rest of the code for this looks horrible(and 
potentially a security risk)... maybe we ought to take this fix for now but 
prioritise replacing this whole function with a C implementation or at least a 
better search for the ipconfig tool.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32370] Wrong ANSI encoding used by subprocess for some locales

2018-02-10 Thread Segev Finer

Change by Segev Finer :


--
versions: +Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32370] Wrong ANSI encoding used by subprocess for some locales

2018-02-10 Thread Segev Finer

Change by Segev Finer :


--
keywords: +patch
pull_requests: +5418
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32370] Wrong ANSI encoding used by subprocess for some locales

2017-12-18 Thread Eryk Sun

Eryk Sun  added the comment:

ipconfig uses (or defaults to) OEM encoded output when writing to a pipe or 
file. On the other hand, Python's TextIOWrapper defaults to ANSI (i.e. 'mbcs'). 
In 3.6+, uuid._ipconfig_getnode could be rewritten to call subprocess.Popen 
with the new 'oem' encoding. 

In Windows 10, the networking command-line utilities (e.g. ipconfig, netstat, 
nbtstat, ping, tracert, hostname, finger, and ftp) support an "OutputEncoding" 
environment variable. Its value can be set to "Unicode" (UTF-16), "UTF-8", or 
"Ansi". I don't think this is supported in Windows 7, however.

--
nosy: +eryksun

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32370] Wrong ANSI encoding used by subprocess for some locales

2017-12-18 Thread Segev Finer

New submission from Segev Finer :

The following test is failing randomly for me (python -m test test_uuid -v):
==
ERROR: test_ipconfig_getnode (test.test_uuid.TestInternalsWithoutExtModule)
--
Traceback (most recent call last):
  File "cpython\lib\test\test_uuid.py", line 551, in test_ipconfig_getnode
node = self.uuid._ipconfig_getnode()
  File "cpython\lib\uuid.py", line 487, in _ipconfig_getnode
for line in pipe:
  File "cpython\lib\encodings\cp1255.py", line 23, in decode
return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x8d in position 682: 
character maps to 

This is caused by trying to decode the output of "ipconfig" using cp1255, while 
the output really uses cp862 and annoyingly it started to print times using the 
current locale (Which displays broken in the console anyhow, question mark 
boxes... *sigh*) in some Windows version (Using Windows 10.0.16299 ATM).

--
components: Windows
messages: 308597
nosy: Segev Finer, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Wrong ANSI encoding used by subprocess for some locales
type: behavior
versions: Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com