[issue17110] sys.argv docs should explaining how to handle encoding issues

2020-06-18 Thread Inada Naoki
Inada Naoki added the comment: > > Manuel Jacob added the comment: > > If the encoding supports it, since which Python version do > Py_DecodeLocale() and os.fsencode() roundtrip? > Maybe, since Python 3.2. FWIW, fsencode is added by Victor in https://bugs.python.org/issue8514 > The

[issue17110] sys.argv docs should explaining how to handle encoding issues

2020-06-18 Thread Manuel Jacob
Manuel Jacob added the comment: If the encoding supports it, since which Python version do Py_DecodeLocale() and os.fsencode() roundtrip? The background of my question is that Mercurial goes some extra rounds to determine the correct encoding to emulate what Py_EncodeLocale() would do:

[issue17110] sys.argv docs should explaining how to handle encoding issues

2020-06-17 Thread Inada Naoki
Inada Naoki added the comment: There is no strict guarantee. I think ASCII, UTF-8, latin1 with surrogateescape guarantee roundtrip. Other legacy encodings like cp932 may not roundtrip. But it is not a huge problem because only Windows use them typically. On Windows: * wchar_t is used in

[issue17110] sys.argv docs should explaining how to handle encoding issues

2020-06-17 Thread Manuel Jacob
Manuel Jacob added the comment: The actual startup code uses Py_DecodeLocale() for converting argv from bytes to unicode. Since which Python version is it guaranteed that Py_DecodeLocale() and os.fsencode() roundtrip? -- nosy: +mjacob ___ Python

[issue17110] sys.argv docs should explaining how to handle encoding issues

2019-03-30 Thread Inada Naoki
Change by Inada Naoki : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.7, Python 3.8 -Python 3.2, Python 3.3, Python 3.4 ___ Python tracker

[issue17110] sys.argv docs should explaining how to handle encoding issues

2019-03-29 Thread miss-islington
miss-islington added the comment: New changeset 5b80cb5584a72044424f2d82d0ae79c720f24c47 by Miss Islington (bot) in branch '3.7': bpo-17110: doc: add note how to get bytes from sys.argv (GH-12602) https://github.com/python/cpython/commit/5b80cb5584a72044424f2d82d0ae79c720f24c47 --

[issue17110] sys.argv docs should explaining how to handle encoding issues

2019-03-29 Thread miss-islington
Change by miss-islington : -- pull_requests: +12559 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue17110] sys.argv docs should explaining how to handle encoding issues

2019-03-29 Thread Inada Naoki
Inada Naoki added the comment: New changeset 38f4e468d4b1e135c67337c18ae142193ba8 by Inada Naoki in branch 'master': bpo-17110: doc: add note how to get bytes from sys.argv (GH-12602) https://github.com/python/cpython/commit/38f4e468d4b1e135c67337c18ae142193ba8 -- nosy:

[issue17110] sys.argv docs should explaining how to handle encoding issues

2019-03-28 Thread Inada Naoki
Change by Inada Naoki : -- pull_requests: +12542 stage: needs patch -> patch review ___ Python tracker ___ ___ Python-bugs-list

[issue17110] sys.argv docs should explaining how to handle encoding issues

2014-03-18 Thread andy.ma
Changes by andy.ma andy.ju...@gmail.com: -- nosy: +andyma ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17110 ___ ___ Python-bugs-list mailing

[issue17110] sys.argv docs should explaining how to handle encoding issues

2014-03-18 Thread Antoine Pitrou
Antoine Pitrou added the comment: Hmm, I'm not sure where those explanations belong but I'm not sure should be in the sys module docs (especially as they are quite lengthy, and they also apply to other data such as os.environ). Perhaps the Unicode HOWTO? --

[issue17110] sys.argv docs should explaining how to handle encoding issues

2014-03-17 Thread Sreepriya Chalakkal
Sreepriya Chalakkal added the comment: You are right. Instead of running ./python inside the python directory, I ran the default python of older version! Based on the stackoverflow link given, I tried to make some documentation. I am attaching the patch! -- keywords: +patch Added

[issue17110] sys.argv docs should explaining how to handle encoding issues

2014-03-15 Thread Sreepriya Chalakkal
Sreepriya Chalakkal added the comment: I tried running with Python 3.4 the following code import sys print(sys.argv[1]) print(b'bytes') And I ran as follows trying to run with a different encoding. $ python ~/a.py `echo priya|iconv -t latin1` priya bytes There was no unicode encode error

[issue17110] sys.argv docs should explaining how to handle encoding issues

2014-03-15 Thread Antoine Pitrou
Antoine Pitrou added the comment: There was no unicode encode error generated! Is it because the problem is fixed? No, it's not fixed. First, it seems you are testing with Python 2 (otherwise you would get b'bytes', not bytes). Python 2 won't have a problem here, since it treats everything

[issue17110] sys.argv docs should explaining how to handle encoding issues

2013-02-02 Thread Nick Coghlan
New submission from Nick Coghlan: The sys.argv docs [1] currently contain no mention of the fact that they are Unicode strings decoded from bytes provided by the OS. They also don't explain how to correct a decoding error by reversing Python's implicit conversion and redoing it based on the

[issue17110] sys.argv docs should explaining how to handle encoding issues

2013-02-02 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17110 ___