[issue47000] Make encoding="locale" uses locale encoding even in UTF-8 mode is enabled.

2022-03-15 Thread Inada Naoki
Inada Naoki added the comment: I created another topic relating this issue. https://discuss.python.org/t/add-legacy-text-encoding-option-to-make-utf-8-default/14281 If we add another option (e.g. legacy_text_encoding), we do not need to change UTF-8 mode behavior

[issue47009] Streamline list.append for the common case

2022-03-15 Thread Inada Naoki
Inada Naoki added the comment: Thank you. I agree that inlining is worth enough. But we already inlined too many functions in ceval and there is an issue caused by it... (bpo-45116) -- ___ Python tracker <https://bugs.python.org/issue47

[issue47000] Make encoding="locale" uses locale encoding even in UTF-8 mode is enabled.

2022-03-19 Thread Inada Naoki
Change by Inada Naoki : -- keywords: +patch pull_requests: +30091 stage: -> patch review pull_request: https://github.com/python/cpython/pull/32003 ___ Python tracker <https://bugs.python.org/issu

[issue46126] Unittest output drives developers to avoid docstrings

2022-03-20 Thread Inada Naoki
Inada Naoki added the comment: > As you can see, the location of the failing test in the log is masked, and > instead the description is present. Could you elaborate? ``` test_index_empty (idlelib.idle_test.test_text.MockTextTest) Failing test with bad description. ... ERROR

[issue46864] Deprecate ob_shash in BytesObject

2022-03-21 Thread Inada Naoki
Change by Inada Naoki : -- pull_requests: +30132 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/32042 ___ Python tracker <https://bugs.python.org/issu

[issue46864] Deprecate ob_shash in BytesObject

2022-03-21 Thread Inada Naoki
Inada Naoki added the comment: I'm sorry. Maybe, ccache hides the warning from me. -- ___ Python tracker <https://bugs.python.org/issue46864> ___ ___ Pytho

[issue46864] Deprecate ob_shash in BytesObject

2022-03-21 Thread Inada Naoki
Inada Naoki added the comment: Since Python 3.13, yes. It will be bit slower. -- ___ Python tracker <https://bugs.python.org/issue46864> ___ ___ Python-bug

[issue46864] Deprecate ob_shash in BytesObject

2022-03-22 Thread Inada Naoki
Inada Naoki added the comment: Since the hash is randomized, using hash(bytes) for such use case is not recommended. User should use stable hash functions instead. I agree that there is few use cases this change cause performance regression. But it is really few compared to overhead of

[issue47000] Make encoding="locale" uses locale encoding even in UTF-8 mode is enabled.

2022-03-22 Thread Inada Naoki
Inada Naoki added the comment: > * sys.getfilesystemencoding(): Python filesystem encoding, return "UTF-8" if > the Python UTF-8 Mode is enabled Yes, althoguh PYTHONLEGACYWINDOWSFSENCODING takes priority. > * locale.getencoding(): Get the locale encoding, LC_CTYPE locale

[issue47000] Make encoding="locale" uses locale encoding even in UTF-8 mode is enabled.

2022-03-22 Thread Inada Naoki
Change by Inada Naoki : -- pull_requests: +30157 pull_request: https://github.com/python/cpython/pull/32068 ___ Python tracker <https://bugs.python.org/issue47

[issue46864] Deprecate ob_shash in BytesObject

2022-03-22 Thread Inada Naoki
Inada Naoki added the comment: Average RAM capacity doesn't grow as CPU cores grows. Additionally, L1+L2 cache is really limited resource compared to CPU or RAM. Bytes object is used for co_code that is hot. So cache efficiency is important. Would you give us more realistic (or real

[issue46864] Deprecate ob_shash in BytesObject

2022-03-23 Thread Inada Naoki
Inada Naoki added the comment: New changeset 894d0ea5afa822c23286e9e68ed80bb1122b402d by Inada Naoki in branch 'main': bpo-46864: Suppress deprecation warnings for ob_shash. (GH-32042) https://github.com/python/cpython/commit/894d0ea5afa822c23286e9e68ed80b

[issue47000] Make encoding="locale" uses locale encoding even in UTF-8 mode is enabled.

2022-03-23 Thread Inada Naoki
Inada Naoki added the comment: I am not sure about we really need "locale encoding at Python startup". For this issue, I don't want to change `encoding="locale"` behavior except ignore UTF-8 mode. So what I want is "current locale encoding" or ANSI code

[issue46864] Deprecate ob_shash in BytesObject

2022-03-23 Thread Inada Naoki
Inada Naoki added the comment: First of all, this is just deprecating direct access of `ob_shash`. This makes users need to use `PyObject_Hash()`. We don't make the final decision about removing it. We just make we can remove it in Python 3.13. RAM and CACHE efficiency is not the

[issue46864] Deprecate ob_shash in BytesObject

2022-03-24 Thread Inada Naoki
Inada Naoki added the comment: > I guess not much difference in benchmarks. > But if put a bytes object into multiple dicts/sets, and len(bytes_key) is > large, it will take a long time. (1 GiB 0.40 seconds on i5-11500 DDR4-3200) > The length of bytes can be arbitrary,so computing

[issue46864] Deprecate ob_shash in BytesObject

2022-03-24 Thread Inada Naoki
Inada Naoki added the comment: OK. Cache efficiency is dropped from motivations list. Current motivations are: * Memory saving (currently, 4 BytesObject (= 32 bytes of ob_shash) per code object. * Make bytes objects immutable * Share objects among multi interpreters. * CoW efficiency. I

[issue47000] Make encoding="locale" uses locale encoding even in UTF-8 mode is enabled.

2022-03-30 Thread Inada Naoki
Inada Naoki added the comment: @vstiner Since UTF-8 mode affects `locale.getpreferredencoding(False)`, I need to decide alternative API in the PEP 686. If no objections, I will choose `locale.get_encoding()` for current locale encoding (ACP on Windows). See https://github.com/python/peps

[issue47000] Make encoding="locale" uses locale encoding even in UTF-8 mode is enabled.

2022-03-30 Thread Inada Naoki
Inada Naoki added the comment: > Please see https://bugs.python.org/issue47000#msg415769 for what Victor > suggested. Of course, I read it. > In particular, the locale module uses the "no underscore" convention. > Not sure whether it's good to start using snake c

[issue47000] Make encoding="locale" uses locale encoding even in UTF-8 mode is enabled.

2022-04-03 Thread Inada Naoki
Inada Naoki added the comment: New changeset 4216dce04b7d3f329beaaafc82a77c4ac6cf4d57 by Inada Naoki in branch 'main': bpo-47000: Make `io.text_encoding()` respects UTF-8 mode (GH-32003) https://github.com/python/cpython/commit/4216dce04b7d3f329beaaafc82a77c

[issue37846] declare that Text I/O use buffer inside

2019-08-13 Thread Inada Naoki
Inada Naoki added the comment: It's just an implementation detail. Python implementation and C implementation behave slightly different. But user program shouldn't rely on the detail. Why do you think implementation details should be declared? Who needs the information? -

[issue37337] Add _PyObject_VectorcallMethod() function

2019-08-13 Thread Inada Naoki
Inada Naoki added the comment: New changeset 43d564c18c97421f73025ac3132a194975c76bd6 by Inada Naoki (Zackery Spytz) in branch 'master': bpo-37337: Fix a GCC 9 warning in Objects/descrobject.c (GH-14814) https://github.com/python/cpython/commit/43d564c18c97421f73025ac3132a19

[issue37664] Update bundled pip and setuptools

2019-08-18 Thread Inada Naoki
Inada Naoki added the comment: When updating pip next time, please update setuptools too. https://setuptools.readthedocs.io/en/latest/history.html#v41-1-0 > #1788: Changed compatibility fallback logic for html.unescape to avoid > accessing HTMLParser.unescape when not nec

[issue37805] json.dump(..., skipkeys=True) has no unit tests

2019-08-26 Thread Inada Naoki
Inada Naoki added the comment: thanks -- nosy: +inada.naoki resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue37328] remove deprecated HTMLParser.unescape

2019-08-26 Thread Inada Naoki
Inada Naoki added the comment: New changeset fae0ed5099de594a9204071d555cb8b76368cbf4 by Inada Naoki in branch 'master': bpo-37328: remove deprecated HTMLParser.unescape (GH-14186) https://github.com/python/cpython/commit/fae0ed5099de594a9204071d555cb8

[issue37328] remove deprecated HTMLParser.unescape

2019-08-26 Thread Inada Naoki
Change by Inada Naoki : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue37587] JSON loads performance improvement for long strings

2019-08-29 Thread Inada Naoki
Change by Inada Naoki : -- pull_requests: +15267 pull_request: https://github.com/python/cpython/pull/15591 ___ Python tracker <https://bugs.python.org/issue37

[issue37587] JSON loads performance improvement for long strings

2019-08-29 Thread Inada Naoki
Inada Naoki added the comment: @mpaolini I don't have enough time in these weeks. Would you try PR-15591? I confirmed up to 4x speedup. But I'm afraid about there is performance regression in simple cases. -- ___ Python track

[issue37990] gc.collect prints debug stats incorrectly

2019-08-30 Thread Inada Naoki
Change by Inada Naoki : -- keywords: +patch pull_requests: +15294 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/15626 ___ Python tracker <https://bugs.python.org/issu

[issue37781] Use "z" for PY_FORMAT_SIZE_T

2019-08-30 Thread Inada Naoki
Inada Naoki added the comment: New changeset d765d81b8fb5ab707bfe8b079348e5038c298aa3 by Inada Naoki in branch 'master': bpo-37781: use "z" for PY_FORMAT_SIZE_T (GH-15156) https://github.com/python/cpython/commit/d765d81b8fb5ab707bfe

[issue37781] Use "z" for PY_FORMAT_SIZE_T

2019-08-30 Thread Inada Naoki
Change by Inada Naoki : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue37990] gc.collect prints debug stats incorrectly

2019-08-30 Thread Inada Naoki
Inada Naoki added the comment: New changeset 013e52fd340d9ef558013b546f25456f94ee1804 by Inada Naoki in branch 'master': bpo-37990: fix gc stats (GH-15626) https://github.com/python/cpython/commit/013e52fd340d9ef558013b546f2545

[issue37990] gc.collect prints debug stats incorrectly

2019-08-30 Thread Inada Naoki
Change by Inada Naoki : -- pull_requests: +15295 pull_request: https://github.com/python/cpython/pull/15627 ___ Python tracker <https://bugs.python.org/issue37

[issue37990] gc.collect prints debug stats incorrectly

2019-08-30 Thread Inada Naoki
Inada Naoki added the comment: New changeset 97a31c7b486c45ba9c21cab5fb96337859a60275 by Inada Naoki in branch '3.8': [3.8] bpo-37990: fix gc stats (GH-15626) https://github.com/python/cpython/commit/97a31c7b486c45ba9c21cab5fb9633

[issue37990] gc.collect prints debug stats incorrectly

2019-08-30 Thread Inada Naoki
Inada Naoki added the comment: Thank you for finding it! My eyes were too focused on portability issue of "%zd"... -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <h

[issue38004] Duplicated sections in changelog

2019-09-02 Thread Inada Naoki
New submission from Inada Naoki : See TOC in https://docs.python.org/3.7/whatsnew/changelog.html Some releases (*) have multiple "Library" and "Security" sections. (*) e.g. 3.6.0a3, 3.6.0a2, 3.6.0a1, 3.5.3rc1, 3.5.2rc1 -- assignee: docs@python components: Do

[issue38006] Crash in remove() weak reference callback of weakref.WeakValueDictionary at Python exit

2019-09-04 Thread Inada Naoki
Change by Inada Naoki : -- nosy: +inada.naoki ___ Python tracker <https://bugs.python.org/issue38006> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue38026] inspect.getattr_static should avoid dynamic lookup

2019-09-04 Thread Inada Naoki
New submission from Inada Naoki : Reported here: https://github.com/python/cpython/commit/feaefc7f60cd3be7bf4ecc2b73e77d2bfe048403 I merged GH-5351 but it broke inspect.getattr_static behavior. It should be reverted. -- components: Library (Lib) keywords: 3.8regression messages

[issue38026] inspect.getattr_static should avoid dynamic lookup

2019-09-04 Thread Inada Naoki
Change by Inada Naoki : -- keywords: +patch pull_requests: +15336 stage: -> patch review pull_request: https://github.com/python/cpython/pull/15676 ___ Python tracker <https://bugs.python.org/issu

[issue38026] inspect.getattr_static should avoid dynamic lookup

2019-09-04 Thread Inada Naoki
Inada Naoki added the comment: New changeset 8f9cc8771ffb8d0e21be287eaed42ae06087acca by Inada Naoki in branch 'master': bpo-38026: fix inspect.getattr_static (GH-15676) https://github.com/python/cpython/commit/8f9cc8771ffb8d0e21be287eaed42a

[issue38026] inspect.getattr_static should avoid dynamic lookup

2019-09-04 Thread Inada Naoki
Change by Inada Naoki : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue33418] Memory leaks in functions

2019-09-10 Thread Inada Naoki
Inada Naoki added the comment: I'm OK to revert it in 3.8. But I am worrying about func.func_closure. Can it create cyclic reference in real life applications? -- ___ Python tracker <https://bugs.python.org/is

[issue36869] Avoid warning of unused variables

2019-09-10 Thread Inada Naoki
Change by Inada Naoki : -- resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue36869> ___

[issue37207] Use PEP 590 vectorcall to speed up calls to range(), list() and dict()

2019-09-12 Thread Inada Naoki
Inada Naoki added the comment: $ ./python -m pyperf timeit --compare-to ./python-master 'dict()' python-master: . 89.9 ns +- 1.2 ns python: . 72.5 ns +- 1.6 ns Mean +- std dev: [python-master] 89.9 ns +- 1.2 ns -> [python] 72.5 ns +- 1

[issue35696] remove unnecessary operation in long_compare()

2019-09-18 Thread Inada Naoki
Inada Naoki added the comment: New changeset 42acb7b8d29d078bc97b0cfd7c4911b2266b26b9 by Inada Naoki (HongWeipeng) in branch 'master': bpo-35696: Simplify long_compare() (GH-16146) https://github.com/python/cpython/commit/42acb7b8d29d078bc97b0cfd7c4911b2266b26b9 -

[issue35696] remove unnecessary operation in long_compare()

2019-09-18 Thread Inada Naoki
Change by Inada Naoki : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.9 -Python 3.8 ___ Python tracker <https://bugs.python.or

[issue26219] implement per-opcode cache in ceval

2019-10-08 Thread Inada Naoki
Inada Naoki added the comment: On Mon, Oct 7, 2019 at 9:41 PM Mark Shannon wrote: > > Mark Shannon added the comment: > > Given that > def foo(): int; str; bytes; float; int; str; bytes; float > can be trivially be rewritten as > def foo(): pass > I think that benchma

[issue38486] Dead links in mailbox doc

2019-10-15 Thread Inada Naoki
New submission from Inada Naoki : Reported on mailing list: https://mail.python.org/archives/list/d...@python.org/thread/NIXFQMWFNSNO6RXPINY56CQQ5L7QIRUV/ qmail.org is dead. The mailbox doc [1] contains two links to man pages in qmail.org. Can we just remove them? [1] https

[issue38477] magiccube2x2 permutations 28% slower with Python 3.8.0rc1 vs 3.7

2019-10-15 Thread Inada Naoki
Change by Inada Naoki : -- nosy: +inada.naoki ___ Python tracker <https://bugs.python.org/issue38477> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue38477] magiccube2x2 permutations 28% slower with Python 3.8.0rc1 vs 3.7

2019-10-15 Thread Inada Naoki
Inada Naoki added the comment: I can not confirm performance regression in 3.8.0. $ time ~/pyenv/versions/3.7.3/bin/python permutations2x2 --max_depth 6 | egrep "^# Total_Time" ; time ~/pyenv/versions/3.8.0/bin/python permutations2x2 --max_depth 6 | egrep "^# Total_Time"

[issue38477] magiccube2x2 permutations 28% slower with Python 3.8.0rc1 vs 3.7

2019-10-15 Thread Inada Naoki
Inada Naoki added the comment: Ah, my bad. I meant `perf stat python ...`. -- ___ Python tracker <https://bugs.python.org/issue38477> ___ ___ Python-bugs-list m

[issue38477] magiccube2x2 permutations 28% slower with Python 3.8.0rc1 vs 3.7

2019-10-15 Thread Inada Naoki
Inada Naoki added the comment: Deadsneak Python 3.8: >>> sysconfig.get_config_var('CFLAGS') '-Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security' Disco /usr/bin/python3.7: >>

[issue38373] List overallocation strategy

2019-10-16 Thread Inada Naoki
Change by Inada Naoki : -- nosy: +inada.naoki ___ Python tracker <https://bugs.python.org/issue38373> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue38495] print built-in function docs bug

2019-10-16 Thread Inada Naoki
Inada Naoki added the comment: Space is not trimmed. You can confirm there is a space by copy&paste it from rendered HTML. print(*objects, sep=' ', end='\n', file=sys.stdout, flush=False)¶ So this is caused by rendering sep=' '. I don't like , but

[issue38495] print built-in function docs bug

2019-10-16 Thread Inada Naoki
Inada Naoki added the comment: https://github.com/sphinx-doc/sphinx/pull/6401/files Recent Sphinx uses . So we can add style like this: .sig-paren { font-family: monospace, sans-serif; font-style: normal; } -- ___ Python tracker

[issue37587] JSON loads performance improvement for long strings

2019-10-17 Thread Inada Naoki
Inada Naoki added the comment: New changeset 9c11029bb41caab5576f354fbf808a5e91325bb0 by Inada Naoki in branch 'master': bpo-37587: json: Use _PyUnicodeWriter when scanning string. (GH-15591) https://github.com/python/cpython/commit/9c11029bb41caab5576f354fbf808a

[issue38503] bug: string search can find \n, but can NEVER find \r

2019-10-17 Thread Inada Naoki
Inada Naoki added the comment: It is "universal newline". See https://docs.python.org/3/library/functions.html#open and https://docs.python.org/3/glossary.html#term-universal-newlines -- nosy: +inada.naoki resolution: -> not a bug stage: -> resolved status

[issue37587] JSON loads performance improvement for long strings

2019-10-17 Thread Inada Naoki
Change by Inada Naoki : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue38525] Strange reversed dict behavior

2019-10-19 Thread Inada Naoki
Inada Naoki added the comment: When dict is empty, di_pos of reverse iterator must be -1, not 0. Additionally, di_pos must be initialized from ma_used when dict is key sharing dict. diff --git a/Objects/dictobject.c b/Objects/dictobject.c index 64876e0519..6c4b41700b 100644 --- a/Objects

[issue38538] dictobject dictviews don't return NotImplemented for unrecognized types.

2019-10-21 Thread Inada Naoki
Inada Naoki added the comment: > Strangely enough, it worked in Python 2.7 It is not strange since dict.keys() in Python 2.7 returns list. >>> {}.viewkeys() | Ror() Traceback (most recent call last): File "", line 1, in TypeError: itera

[issue38538] dictobject dictviews don't return NotImplemented for unrecognized types.

2019-10-28 Thread Inada Naoki
Inada Naoki added the comment: > but it's not that simple as the __or__ of dictviews is less strict that the > __or__ of set: __or__ of dictview accept any iterable, __or__ of set only > accepts sets. I want to make it same to set. But it is a backwar

[issue38604] Schedule Py_UNICODE API removal

2019-10-28 Thread Inada Naoki
Inada Naoki added the comment: I want to remove them in 3.10 too. If we chose the annual release cycle, I'm OK to postpone the removal to 3.11. FWIW, ujson is apopular extension that uses these APIs. But it is not maintained for a long time, and there are many alternative JSON libr

[issue38613] Optimize some set operations in dictkeys object

2019-10-28 Thread Inada Naoki
New submission from Inada Naoki : -, |, and ^ of dictkeys are implemented as: PyObject *result = PySet_New(self); // Call set.difference_update, set.update, set.symmetric_difference_update with other. PySet_New(iterable) has optimized step for iterable is dict. But since iterable is dictkeys

[issue38613] Optimize some set operations in dictkeys object

2019-10-28 Thread Inada Naoki
Change by Inada Naoki : -- keywords: +patch pull_requests: +16489 stage: -> patch review pull_request: https://github.com/python/cpython/pull/16961 ___ Python tracker <https://bugs.python.org/issu

[issue38613] Optimize some set operations in dictkeys object

2019-10-28 Thread Inada Naoki
Inada Naoki added the comment: > How does it work with dict subclasses? PySet_New(iterable) uses fast path only when `PyDict_CheckExact(iterable)` is true. So there is no change for dict subclasses. -- ___ Python tracker <

[issue38613] Optimize some set operations in dictkeys object

2019-10-30 Thread Inada Naoki
Inada Naoki added the comment: done. -- ___ Python tracker <https://bugs.python.org/issue38613> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue38613] Optimize some set operations in dictkeys object

2019-11-07 Thread Inada Naoki
Inada Naoki added the comment: New changeset 6cbc84fb99acb33dd659d7adb29a20adbe62b74a by Inada Naoki in branch 'master': bpo-38613: Optimize set operations of dict keys. (GH-16961) https://github.com/python/cpython/commit/6cbc84fb99acb33dd659d7adb29a20

[issue38613] Optimize some set operations in dictkeys object

2019-11-07 Thread Inada Naoki
Change by Inada Naoki : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue43214] site: Potential UnicodeDecodeError when handling pth file

2021-03-12 Thread Inada Naoki
Change by Inada Naoki : -- superseder: -> Use io.open_code for .pth files ___ Python tracker <https://bugs.python.org/issue43214> ___ ___ Python-bugs-list mai

[issue43214] site: Potential UnicodeDecodeError when handling pth file

2021-03-12 Thread Inada Naoki
Change by Inada Naoki : -- keywords: +patch pull_requests: +23602 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24837 ___ Python tracker <https://bugs.python.org/issu

[issue43506] PEP 624: Update document for removal schedule

2021-03-15 Thread Inada Naoki
New submission from Inada Naoki : They are documented as "will be removed in 4.0" now. -- components: C API messages: 388800 nosy: methane priority: normal severity: normal status: open title: PEP 624: Update document for removal schedule versions: Python 3.10,

[issue43506] PEP 624: Update document for removal schedule

2021-03-15 Thread Inada Naoki
Change by Inada Naoki : -- keywords: +patch pull_requests: +23646 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24885 ___ Python tracker <https://bugs.python.org/issu

[issue43510] PEP 597: Implemente encoding="locale" option and EncodingWarning

2021-03-15 Thread Inada Naoki
New submission from Inada Naoki : PEP 597 is accepted. -- components: IO messages: 388809 nosy: methane priority: normal severity: normal status: open title: PEP 597: Implemente encoding="locale" option and EncodingWarning versions: P

[issue41123] Remove Py_UNICODE APIs except PEP 623

2021-03-15 Thread Inada Naoki
Change by Inada Naoki : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue43506] PEP 624: Update document for removal schedule

2021-03-15 Thread Inada Naoki
Inada Naoki added the comment: New changeset 1330338583d183250186a8123b99d2283e945b4f by Inada Naoki in branch 'master': bpo-43506: Doc: Update removal schedule for Py_UNICODE encoder APIs (GH-24885) https://github.com/python/cpython/commit/1330338583d183250186a8123b99d2

[issue43510] PEP 597: Implemente encoding="locale" option and EncodingWarning

2021-03-15 Thread Inada Naoki
Change by Inada Naoki : -- keywords: +patch pull_requests: +23653 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19481 ___ Python tracker <https://bugs.python.org/issu

[issue43506] PEP 624: Update document for removal schedule

2021-03-15 Thread Inada Naoki
Inada Naoki added the comment: New changeset dc8558ef302f1b14b45c21abd7451e4fb56b4604 by Miss Islington (bot) in branch '3.8': bpo-43506: Doc: Update removal schedule for Py_UNICODE encoder APIs (GH-24885) https://github.com/python/cpython/commit/dc8558ef302f1b14b45c21abd7451e

[issue43506] PEP 624: Update document for removal schedule

2021-03-15 Thread Inada Naoki
Change by Inada Naoki : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue42578] Add tip when encountering UnicodeDecode/EncodeError in open()

2021-03-15 Thread Inada Naoki
Inada Naoki added the comment: PEP 597 is accepted. May I close this? -- ___ Python tracker <https://bugs.python.org/issue42578> ___ ___ Python-bugs-list mailin

[issue43214] site: Potential UnicodeDecodeError when handling pth file

2021-03-17 Thread Inada Naoki
Inada Naoki added the comment: locale-specific encoding is not good especially for Windows. But we used it for a long time. Changing the encoding for pth files is breaking change. -- resolution: -> not a bug stage: patch review -> resolved status: open -&g

[issue43552] Add locale.get_locale_encoding() and locale.get_current_locale_encoding()

2021-03-19 Thread Inada Naoki
Inada Naoki added the comment: > I created this issue while reviewing the implementation of the PEP 597: PR > 19481. What I want is same to `locale.getpreferredencoding(False)` but ignores UTF-8 mode. Background: PEP 597 adds new `encoding="locale"`option to open() and Tex

[issue43552] Add locale.get_locale_encoding() and locale.get_current_locale_encoding()

2021-03-19 Thread Inada Naoki
Inada Naoki added the comment: > Is it about the current implementation of the PEP 597, or are you thinking at > the future Python which would use UTF-8 by default? I had forgot to consider about UTF-8 mode while finishing PEP 597. If possible, I want to ignore UTF-8 mode when `en

[issue43510] PEP 597: Implemente encoding="locale" option and EncodingWarning

2021-03-19 Thread Inada Naoki
Inada Naoki added the comment: > Since the final goal is to move everybody towards to UTF-8, I'm not sure how > it's a good thing. The final goal (the third motivation of the pep 597) is changing the default encoding (i.e. encoding used when it is not specified) to UTF

[issue43510] PEP 597: Implemente encoding="locale" option and EncodingWarning

2021-03-19 Thread Inada Naoki
Inada Naoki added the comment: > (1) "UTF-8" in the UTF-8 Mode, or the locale encoding > (2) Always use the locale encoding, ignore the UTF-8 Mode > > What I don't expect is the current behavior, before PEP 597. Who uses open() > without specifying an encod

[issue43552] Add locale.get_locale_encoding() and locale.get_current_locale_encoding()

2021-03-19 Thread Inada Naoki
Inada Naoki added the comment: > Please address UTF-8 mode explicitly in open() or elsewhere. The locale > module is about the state of the lib C, not what Python enforces via > options in its own I/O layers. I agree with you. APIs in locale module shouldn't aw

[issue43552] Add locale.get_locale_encoding() and locale.get_current_locale_encoding()

2021-03-19 Thread Inada Naoki
Inada Naoki added the comment: > Why is it being specified that the current LC_CTYPE encoding should be > ignored in Windows when a "locale" encoding is requested? Because `encoding="locale"` must be replacement of the current `encoding=None` (i.e. locale.

[issue33164] Blake 2 module update

2021-03-28 Thread Inada Naoki
Change by Inada Naoki : -- pull_requests: +23808 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/25060 ___ Python tracker <https://bugs.python.org/issu

[issue43510] PEP 597: Implemente encoding="locale" option and EncodingWarning

2021-03-28 Thread Inada Naoki
Inada Naoki added the comment: New changeset 4827483f47906fecee6b5d9097df2a69a293a85c by Inada Naoki in branch 'master': bpo-43510: Implement PEP 597 opt-in EncodingWarning. (GH-19481) https://github.com/python/cpython/commit/4827483f47906fecee6b5d9097df2a

[issue43651] PEP 597: Fix EncodingError

2021-03-28 Thread Inada Naoki
Change by Inada Naoki : -- nosy: methane priority: normal severity: normal status: open title: PEP 597: Fix EncodingError versions: Python 3.10 ___ Python tracker <https://bugs.python.org/issue43

[issue37945] [Windows] test_locale.TestMiscellaneous.test_getsetlocale_issue1813() fails

2021-03-28 Thread Inada Naoki
Change by Inada Naoki : -- keywords: +patch nosy: +methane nosy_count: 13.0 -> 14.0 pull_requests: +23809 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/19481 ___ Python tracker <https://bugs.p

[issue43653] Typo in the random.shuffle docs

2021-03-29 Thread Inada Naoki
Inada Naoki added the comment: https://en.wikipedia.org/wiki/Interval_(mathematics) See "Notations for intervals" section in the Wikipedia page. -- nosy: +methane ___ Python tracker <https://bugs.python.o

[issue33164] Blake 2 module update

2021-03-29 Thread Inada Naoki
Inada Naoki added the comment: New changeset 068ebf9729d440cef03e4c57e3db83c851146172 by Inada Naoki in branch 'master': bpo-33164: blake2: Fix Coverity scan (GH-25060) https://github.com/python/cpython/commit/068ebf9729d440cef03e4c57e3db83

[issue33164] Blake 2 module update

2021-03-30 Thread Inada Naoki
Change by Inada Naoki : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue43510] PEP 597: Implemente encoding="locale" option and EncodingWarning

2021-03-30 Thread Inada Naoki
Inada Naoki added the comment: I created bpo-43651 to track fixing EncodingError in Python stdlibs. I close this issue for now. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracke

[issue43651] PEP 597: Fix EncodingWarning warnings in the Python stdlib

2021-03-30 Thread Inada Naoki
Change by Inada Naoki : -- keywords: +patch pull_requests: +23841 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25097 ___ Python tracker <https://bugs.python.org/issu

[issue43510] PEP 597: Implemente encoding="locale" option and EncodingWarning

2021-03-30 Thread Inada Naoki
Inada Naoki added the comment: In bpo-43651, I found code pattern that it's difficult to use io.text_encoding(): class OpenWrapper: def __new__(cls, *args, **kwargs): return open(*args, **kwargs) `kwargs["encoding"] = text_encoding(kwargs.get("enc

[issue43651] PEP 597: Fix EncodingWarning warnings in the Python stdlib

2021-03-30 Thread Inada Naoki
Change by Inada Naoki : -- superseder: -> PEP 597: Implemente encoding="locale" option and EncodingWarning ___ Python tracker <https://bugs.pytho

[issue43510] PEP 597: Implemente encoding="locale" option and EncodingWarning

2021-03-30 Thread Inada Naoki
Change by Inada Naoki : -- pull_requests: +23848 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/25103 ___ Python tracker <https://bugs.python.org/issu

[issue43510] PEP 597: Implemente encoding="locale" option and EncodingWarning

2021-03-30 Thread Inada Naoki
Inada Naoki added the comment: New changeset ff3c9739bd69aa8b58007e63c9e40e6708b4761e by Inada Naoki in branch 'master': bpo-43510: PEP 597: Accept `encoding="locale"` in binary mode (GH-25103) https://github.com/python/cpython/commit/ff3c9739bd69aa8b5800

[issue43510] PEP 597: Implemente encoding="locale" option and EncodingWarning

2021-03-30 Thread Inada Naoki
Change by Inada Naoki : -- pull_requests: +23851 pull_request: https://github.com/python/cpython/pull/25107 ___ Python tracker <https://bugs.python.org/issue43

[issue43510] PEP 597: Implemente encoding="locale" option and EncodingWarning

2021-03-30 Thread Inada Naoki
Inada Naoki added the comment: I'm sorry, I was wrong. Allowing `encoding="locale"` didn't help OpenWrapper. See GH-25107. If we use `encoding = text_encoding(encoding)` in binary mode, `open(filename, "rb")` will be warned. This doesn't make sense at a

<    1   2   3   4   5   6   7   8   9   10   >