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

2021-04-05 Thread Inada Naoki
Change by Inada Naoki : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___ P

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

2021-04-02 Thread Inada Naoki
Inada Naoki added the comment: New changeset bec8c787ec72d73b39011bde3f3a93e9bb1174b7 by Inada Naoki in branch 'master': bpo-43510: Fix emitting EncodingWarning from _io module. (GH-25146) https://github.com/python/cpython/commit/bec8c787ec72d73b39011bde3f3a93e9bb1174b7 --

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

2021-04-02 Thread Inada Naoki
Change by Inada Naoki : -- pull_requests: +23893 pull_request: https://github.com/python/cpython/pull/25146 ___ Python tracker ___ _

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

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

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

2021-03-31 Thread M.-A. Lemburg
On 31.03.2021 11:30, STINNER Victor wrote: > > To me, it sounds really weird to accept an encoding when a file is opened in > binary mode. open(filename, "rb", encoding="locale") looks like a bug. Same here. If encoding is used as an argument and then not used, this is a bug, not a feature :-)

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

2021-03-31 Thread STINNER Victor
STINNER Victor added the comment: To me, it sounds really weird to accept an encoding when a file is opened in binary mode. open(filename, "rb", encoding="locale") looks like a bug. -- ___ Python tracker __

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

2021-03-31 Thread Eryk Sun
Change by Eryk Sun : -- Removed message: https://bugs.python.org/msg389828 ___ Python tracker ___ ___ Python-bugs-list mailing list

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

2021-03-30 Thread Inada Naoki
Change by Inada Naoki : -- pull_requests: +23852 pull_request: https://github.com/python/cpython/pull/25108 ___ Python tracker ___ _

[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 all. Adding `mode` parameter to the `te

[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 ___ _

[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/ff3c9739bd69aa8b58007e63c9e40e6708b4761e -- ___

[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 ___ _

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

2021-03-30 Thread Eryk Sun
Eryk Sun added the comment: > I think we should accept `encoding="locale"` even in binary mode. That's a good idea. It means the same as passing None, except it avoids a warning. -- nosy: +eryksun ___ Python tracker

[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("encoding)` doesn't work

[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 tracker

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

2021-03-29 Thread STINNER Victor
STINNER Victor added the comment: Yeah! Congrats INADA-san for implementing your PEP! -- ___ Python tracker ___ ___ Python-bugs-lis

[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/4827483f47906fecee6b5d9097df2a69a293a85c --

[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 encoding but always want to use the locale

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

2021-03-19 Thread STINNER Victor
STINNER Victor added the comment: I see different cases when open() is called with no encoding argument: (A) User wants to use UTF-8: add encoding="utf-8" (B) Windows user wants to use the ANSI code page of their computer, local file not intended to be shared with other computers: add encodi

[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-8. But forcing people

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

2021-03-19 Thread STINNER Victor
STINNER Victor added the comment: I replied to INADA-san message on bpo-43552: https://bugs.python.org/issue43552#msg389091 > I had forgot to consider about UTF-8 mode while finishing PEP 597. If > possible, I want to ignore UTF-8 mode when `encoding="locale"` is specified > from Python 3.10

[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 ___

[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: Python 3.10 ___ P