[issue33865] [EASY] Missing code page aliases: "unknown encoding: 874"

2018-07-12 Thread STINNER Victor
Change by STINNER Victor : -- resolution: -> third party stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue33865] [EASY] Missing code page aliases: "unknown encoding: 874"

2018-06-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you Inada-san! Seems this issue can be closed as a third party issue. -- ___ Python tracker ___ _

[issue33865] [EASY] Missing code page aliases: "unknown encoding: 874"

2018-06-25 Thread INADA Naoki
INADA Naoki added the comment: I found original pull request and issue report https://github.com/conda/conda/pull/4558 https://github.com/ContinuumIO/anaconda-issues/issues/1410 -- ___ Python tracker __

[issue33865] [EASY] Missing code page aliases: "unknown encoding: 874"

2018-06-25 Thread INADA Naoki
INADA Naoki added the comment: I grepped PYTHONIOENCODING and found this line. https://github.com/conda/conda/blob/082fe8fd7458ecd9dd7547749039f4b1f06d76db/conda/activate.py#L726 -- ___ Python tracker __

[issue33865] [EASY] Missing code page aliases: "unknown encoding: 874"

2018-06-25 Thread INADA Naoki
INADA Naoki added the comment: When I grepped "Unknown encoding 874", I see some people got trouble from anaconda installation. I don't know about what anaconda setup does, but it will not happen on normal CPython. We use UTF-8 by default on Windows, for fsencoding and console encoding, from

[issue33865] [EASY] Missing code page aliases: "unknown encoding: 874"

2018-06-25 Thread INADA Naoki
Change by INADA Naoki : -- nosy: +inada.naoki ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.py

[issue33865] [EASY] Missing code page aliases: "unknown encoding: 874"

2018-06-19 Thread STINNER Victor
STINNER Victor added the comment: Prawin Phichitnitikorn: "But for me I'm resolve by adding (...)" Ok, so can you please give the value of: * sys.stdin.encoding * sys.stdout.encoding * sys.stderr.encoding * os.device_encoding(0) * os.device_encoding(1) * os.device_encoding(2) * locale.getpref

[issue33865] [EASY] Missing code page aliases: "unknown encoding: 874"

2018-06-19 Thread Ronald Oussoren
Ronald Oussoren added the comment: @Serhiy: The screenshot suggests that this is regular python install. -- ___ Python tracker ___

[issue33865] [EASY] Missing code page aliases: "unknown encoding: 874"

2018-06-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: * Does you use a regular Python interpreter or embedded in other program? -- ___ Python tracker ___ ___

[issue33865] [EASY] Missing code page aliases: "unknown encoding: 874"

2018-06-19 Thread Ronald Oussoren
Ronald Oussoren added the comment: In particular, we're interested in the following information: * What OS is installed on your machine? * What locale (country/language) is configured? * What does "import locale; print(locale._getdefaultlocale())" print? -- __

[issue33865] [EASY] Missing code page aliases: "unknown encoding: 874"

2018-06-18 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: Thanks @prawin for the confirmation. There is a mailing list discussion at https://groups.google.com/forum/#!topic/python-ideas/Ny1RN9wY0cI and it seems this is related to Thai language locale. Feel free to add in if you have any more input on if i

[issue33865] [EASY] Missing code page aliases: "unknown encoding: 874"

2018-06-18 Thread Prawin Phichitnitikorn
Prawin Phichitnitikorn added the comment: Sorry for late Reply, But for me I'm resolve by adding # cp874 codec '874': 'cp874', to alias.py file -- ___ Python tracker _

[issue33865] [EASY] Missing code page aliases: "unknown encoding: 874"

2018-06-18 Thread Ronald Oussoren
Ronald Oussoren added the comment: Confirmation that the patch actually fixes the problem would be nice, but I'd still like to understand why Python tries to use an encoding with the name "874" as this might lead to a nicer solution to the problem. BTW. There is some discussion on this issue

[issue33865] [EASY] Missing code page aliases: "unknown encoding: 874"

2018-06-18 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: I think if we can get a confirmation from @Prawin that adding an alias fixed the issue or a minimal test case then it will be helpful. The minimal I can come up with is as below : import codecs # Fails without alias being added other cases like

[issue33865] [EASY] Missing code page aliases: "unknown encoding: 874"

2018-06-18 Thread Ronald Oussoren
Ronald Oussoren added the comment: I'm not convinced that adding code to search_function is the right solution for this. BTW. I'm also not sure yet why this error happens, does windows return a codepage number as the preferred encoding when the io module looks for one? If so, wouldn't it b

[issue33865] [EASY] Missing code page aliases: "unknown encoding: 874"

2018-06-16 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: I am able to verify the newly added aliases using the below assert statement assert codecs.encode('a', '874') == codecs.encode('a', 'cp874') I am struck on the part where it could be patched in the search_function and I hope this is the approach @s

[issue33865] [EASY] Missing code page aliases: "unknown encoding: 874"

2018-06-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It is easy to test it. Encoding/decoding with '874' should give the same result as with 'cp874'. -- ___ Python tracker ___ ___

[issue33865] [EASY] Missing code page aliases: "unknown encoding: 874"

2018-06-16 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: Thanks @serhiy.storchaka . I looked into the code and it seems the resolution is done in `search_function` at Lib/encodings/__init__.py . It seems that encoding is normalized using some logic and then we use the normalized encoding to check against

[issue33865] [EASY] Missing code page aliases: "unknown encoding: 874"

2018-06-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Of course entries in the alias table should have a precedence. -- ___ Python tracker ___ ___ Py

[issue33865] [EASY] Missing code page aliases: "unknown encoding: 874"

2018-06-15 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: There are certain encodings as I went through the file Lib/encodings/aliases.py where there are all digit items that doesn't correspond to cp sequence. I think the search function is used not only for encodings that start with 'cp' and thus ad

[issue33865] [EASY] Missing code page aliases: "unknown encoding: 874"

2018-06-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Why only these code pages? There are other cp encodings that don't have the alias. Maybe add a logic in encodings.search_function() that will map to cp if it is all digits? Maybe even map ibm and windows_ to cp, but this will

[issue33865] [EASY] Missing code page aliases: "unknown encoding: 874"

2018-06-15 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: Thanks @ronaldoussoren for the links. I have added an entry using blurb tool and updated the docs at Doc/library/codecs.rst with relevant aliases. Thanks -- ___ Python tracker

[issue33865] [EASY] Missing code page aliases: "unknown encoding: 874"

2018-06-15 Thread Ronald Oussoren
Ronald Oussoren added the comment: Could you also add a documentation update and a news entry? The section on standard encodings mentions aliases for standard encodings, and IMHO the new aliases should be added to that page. Creating a new entry is described here: https://devguide.python.

[issue33865] [EASY] Missing code page aliases: "unknown encoding: 874"

2018-06-15 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: I have added the aliases as per comment by @vstinner https://bugs.python.org/msg319590 . I have used https://docs.python.org/3.8/library/codecs.html#standard-encodings as a reference to see if there are any additional aliases to add with respect to

[issue33865] [EASY] Missing code page aliases: "unknown encoding: 874"

2018-06-15 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- keywords: +patch pull_requests: +7321 stage: -> patch review ___ Python tracker ___ ___ Pyt

[issue33865] [EASY] Missing code page aliases: "unknown encoding: 874"

2018-06-15 Thread STINNER Victor
STINNER Victor added the comment: It seems like the following code pages have a Python codec (Lib/encoding/cpXXX.py) but lack an alias in Lib/encodings/aliases.py: [720, 737, 856, 874, 875, 1006, 65001] Is someone volunteer to write a pull request for that? It should be easy. Example of a c