[issue29783] Modify codecs.open() to use the io module instead of codecs.StreamReaderWriter()

2017-06-16 Thread STINNER Victor
Changes by STINNER Victor : -- resolution: -> rejected stage: -> resolved status: open -> closed ___ Python tracker ___ ___ Python-b

[issue29783] Modify codecs.open() to use the io module instead of codecs.StreamReaderWriter()

2017-06-15 Thread STINNER Victor
STINNER Victor added the comment: New changeset 272d888c7b58aff5e1614e3b12e8198b92054835 by Victor Stinner in branch 'master': bpo-29783: Replace codecs.open() with io.open() (#599) https://github.com/python/cpython/commit/272d888c7b58aff5e1614e3b12e8198b92054835 -- _

[issue29783] Modify codecs.open() to use the io module instead of codecs.StreamReaderWriter()

2017-03-27 Thread STINNER Victor
STINNER Victor added the comment: I abandonned my pull request. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscrib

[issue29783] Modify codecs.open() to use the io module instead of codecs.StreamReaderWriter()

2017-03-10 Thread Martin Panter
Martin Panter added the comment: I agree that it would be better to hold off deprecating codecs.open until Python 2 is no longer supported. This deprecation also discussed in Issue 8796. There is more to compatability than the missing attributes. The most obvious one to me is that the TextIOBa

[issue29783] Modify codecs.open() to use the io module instead of codecs.StreamReaderWriter()

2017-03-10 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I think using codecs.open() with a non-text codecs is a legit use case, but is not the best way. I suggest: 1) Encourage of using io.open() rather than codecs.open() for text encodings. codecs.open() was recommended way since it worked in all Python versions

[issue29783] Modify codecs.open() to use the io module instead of codecs.StreamReaderWriter()

2017-03-10 Thread STINNER Victor
STINNER Victor added the comment: About the issue #12508, would it be possible to modify StreamReader to use an incremental decoder? Or my idea doesn't make sense? -- ___ Python tracker ___

[issue29783] Modify codecs.open() to use the io module instead of codecs.StreamReaderWriter()

2017-03-10 Thread STINNER Victor
STINNER Victor added the comment: Serhiy Storchaka added the comment: > I agree that it is better to use directly the module implementing the codecs. > But old third-party code still can use non-text codecs. > > There should be good reasons for breaking backward compatibility. Wouldn't be > bet

[issue29783] Modify codecs.open() to use the io module instead of codecs.StreamReaderWriter()

2017-03-10 Thread STINNER Victor
STINNER Victor added the comment: > The reason for the problem is the UTF-8 decoder (and other > decoders) expecting an extension to the codec decoder API, > which are not implemented in its StreamReader class (it simply > uses the base class). It's not a problem of the base class, but > that of

[issue29783] Modify codecs.open() to use the io module instead of codecs.StreamReaderWriter()

2017-03-10 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I agree that it is better to use directly the module implementing the codecs. But old third-party code still can use non-text codecs. There should be good reasons for breaking backward compatibility. Wouldn't be better to deprecate codecs.open()? --

[issue29783] Modify codecs.open() to use the io module instead of codecs.StreamReaderWriter()

2017-03-10 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 10.03.2017 15:17, STINNER Victor wrote: > > The codecs.StreamReaderWriter() class still has old unfixed issues like the > issue #12508 (open since 2011). This issue is even seen as a security > vulnerability by the owasp-pysec project: > https://github.

[issue29783] Modify codecs.open() to use the io module instead of codecs.StreamReaderWriter()

2017-03-10 Thread STINNER Victor
STINNER Victor added the comment: > codecs.open() works with bytes-to-bytes codecs. Oh ok. What are non-text encodings? I found: * base64 * bz2 * hex * quopri * rot13 * uu * zlib It seems like all these codecs can be used with codecs.open() to write bytes strings, except of rot13. Last time

[issue29783] Modify codecs.open() to use the io module instead of codecs.StreamReaderWriter()

2017-03-10 Thread STINNER Victor
Changes by STINNER Victor : -- pull_requests: +492 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail

[issue29783] Modify codecs.open() to use the io module instead of codecs.StreamReaderWriter()

2017-03-10 Thread STINNER Victor
Changes by STINNER Victor : -- pull_requests: +493 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail

[issue29783] Modify codecs.open() to use the io module instead of codecs.StreamReaderWriter()

2017-03-10 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: codecs.open() works with bytes-to-bytes codecs. >>> f = codecs.open('test1', 'w', encoding='hex_codec') >>> f.write(b'hello') >>> f.close() >>> open('test1', 'rb').read() b'68656c6c6f' In additional the interface of StreamReaderWriter is not fully compatible

[issue29783] Modify codecs.open() to use the io module instead of codecs.StreamReaderWriter()

2017-03-10 Thread STINNER Victor
New submission from STINNER Victor: The codecs.StreamReaderWriter() class still has old unfixed issues like the issue #12508 (open since 2011). This issue is even seen as a security vulnerability by the owasp-pysec project: https://github.com/ebranca/owasp-pysec/wiki/Unicode-string-silently-tru