[issue8838] Remove codecs.readbuffer_encode() and codecs.charbuffer_encode()

2010-06-14 Thread STINNER Victor
Changes by STINNER Victor : -- resolution: -> fixed status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list Un

[issue8838] Remove codecs.readbuffer_encode() and codecs.charbuffer_encode()

2010-06-14 Thread STINNER Victor
STINNER Victor added the comment: This issue was about removing codecs.readbuffer_encode() and codecs.charbuffer_encode(). codecs.charbuffer_encode() was removed, but codecs.readbuffer_encode() explained that it should be kept. So I close this issue because there is nothing more to do on this

[issue8838] Remove codecs.readbuffer_encode() and codecs.charbuffer_encode()

2010-06-09 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: STINNER Victor wrote: > > STINNER Victor added the comment: > > r81854 removes codecs.charbuffer_encode() (and t# parsing format) from Python > 3.2 (blocked in 3.1: r81855). > > -- > > My problem with codecs.readbuffer_encode() is that it does accept b

[issue8838] Remove codecs.readbuffer_encode() and codecs.charbuffer_encode()

2010-06-08 Thread STINNER Victor
STINNER Victor added the comment: r81854 removes codecs.charbuffer_encode() (and t# parsing format) from Python 3.2 (blocked in 3.1: r81855). -- My problem with codecs.readbuffer_encode() is that it does accept byte *and* character strings. If you want to get a byte string, just use bytes(in

[issue8838] Remove codecs.readbuffer_encode() and codecs.charbuffer_encode()

2010-06-08 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Antoine Pitrou wrote: > > Antoine Pitrou added the comment: > >> Please leave readbuffer_encode() as-is. > > Then please add documentation for it. Will do. -- title: Remove codecs.readbuffer_encode()and codecs.charbuffer_encode() -> Re

[issue8838] Remove codecs.readbuffer_encode() and codecs.charbuffer_encode()

2010-06-08 Thread Antoine Pitrou
Antoine Pitrou added the comment: > Please leave readbuffer_encode() as-is. Then please add documentation for it. -- title: Remove codecs.readbuffer_encode()and codecs.charbuffer_encode() -> Remove codecs.readbuffer_encode() and codecs.charbuffer_encode() ___

[issue8838] Remove codecs.readbuffer_encode() and codecs.charbuffer_encode()

2010-06-08 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: STINNER Victor wrote: > > STINNER Victor added the comment: > > MAL agreed to remove "t#" parsing format (#8839), whereas charbuffer_encode() > main goal was to offer "t#" parsing format to Python object space. > charbuffer_encode() is now useless in Py

[issue8838] Remove codecs.readbuffer_encode() and codecs.charbuffer_encode()

2010-06-07 Thread STINNER Victor
STINNER Victor added the comment: MAL agreed to remove "t#" parsing format (#8839), whereas charbuffer_encode() main goal was to offer "t#" parsing format to Python object space. charbuffer_encode() is now useless in Python3. bytes() accepts any buffer object (read-only and read/write buffer)

[issue8838] Remove codecs.readbuffer_encode() and codecs.charbuffer_encode()

2010-05-28 Thread Martin v . Löwis
Martin v. Löwis added the comment: > Martin said these codecs are coming back in 3.2. I think you are confusing me with MAL. I remain opposed to adding them back. Users ought to use the modules that provide these these conversions as functions. -- title: Remove codecs.readbuffer_enco

[issue8838] Remove codecs.readbuffer_encode() and codecs.charbuffer_encode()

2010-05-28 Thread Éric Araujo
Éric Araujo added the comment: > I don't like readbuffer_*encode* and *charbuffer_encode* > function names, because there are different than other codecs “transform” as hinted by MvL seems perfect. Thanks everyone for the pointers here and in #7475! I’ll search the missing one (“it was discuss

[issue8838] Remove codecs.readbuffer_encode() and codecs.charbuffer_encode()

2010-05-28 Thread Antoine Pitrou
Antoine Pitrou added the comment: > > And all this doesn't address the fact that these functions have never > > been documented, and don't seem used in the outside world > > (understandably so, since there's no way to know about their existence, > > and their intended use). > > That's a documen

[issue8838] Remove codecs.readbuffer_encode() and codecs.charbuffer_encode()

2010-05-28 Thread STINNER Victor
STINNER Victor added the comment: > readbuffer_encode() and charbuffer_encode() are not really encoder > nor related to encodings: they are related to PyBuffer That was the initial problem: codecs is specific to encodings (in Python3), encodes str to bytes, and decodes bytes (or any read buff

[issue8838] Remove codecs.readbuffer_encode() and codecs.charbuffer_encode()

2010-05-28 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: STINNER Victor wrote: > >> Martin said these codecs are coming back in 3.2. I said that and it was discussed on the python-dev mailing list a while back. We'll also add .transform() methods on bytes and str objects to access same-type codecs. --

[issue8838] Remove codecs.readbuffer_encode() and codecs.charbuffer_encode()

2010-05-28 Thread STINNER Victor
STINNER Victor added the comment: > Oh, there is the issue #7485 where Martin wrote: Copy/paste failure: issue #7475. -- ___ Python tracker ___ _

[issue8838] Remove codecs.readbuffer_encode() and codecs.charbuffer_encode()

2010-05-28 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Antoine Pitrou wrote: > > Antoine Pitrou added the comment: > >> class BinaryDataCodec(codecs.Codec): >> >> # Note: Binding these as C functions will result in the class not >> # converting them to methods. This is intended. >> encode = codecs

[issue8838] Remove codecs.readbuffer_encode() and codecs.charbuffer_encode()

2010-05-28 Thread Walter Dörwald
Walter Dörwald added the comment: > > I’d be grateful if someone could post links to discussion > > about the removal of codecs like hex and rot13 > r55932 (~3 years ago): That was my commit. ;) > Thanks for the link. Do you have a pointer to the PEP or ML thread > discussing that change? The

[issue8838] Remove codecs.readbuffer_encode() and codecs.charbuffer_encode()

2010-05-28 Thread STINNER Victor
STINNER Victor added the comment: > Martin said these codecs are coming back in 3.2. Oh, there is the issue #7485 where Martin wrote: * 2009-12-10 23:15: "It was a mistake that they were integrated" * 2009-12-12 19:25: "I would still be opposed to such a change (...) adding them would be reall

[issue8838] Remove codecs.readbuffer_encode() and codecs.charbuffer_encode()

2010-05-28 Thread Éric Araujo
Éric Araujo added the comment: Thanks for the link. Do you have a pointer to the PEP or ML thread discussing that change? “Which coming back?” Martin said these codecs are coming back in 3.2. -- title: Remove codecs.readbuffer_encode()and codecs.charbuffer_encode() -> Remove c

[issue8838] Remove codecs.readbuffer_encode() and codecs.charbuffer_encode()

2010-05-28 Thread STINNER Victor
STINNER Victor added the comment: > I’d be grateful if someone could post links to discussion > about the removal of codecs like hex and rot13 r55932 (~3 years ago): "Rip out all codecs that can't work in a unicode/bytes world: base64, uu, zlib, rot_13, hex, quopri, bz2, string_escape. Howeve

[issue8838] Remove codecs.readbuffer_encode() and codecs.charbuffer_encode()

2010-05-28 Thread Antoine Pitrou
Antoine Pitrou added the comment: > class BinaryDataCodec(codecs.Codec): > > # Note: Binding these as C functions will result in the class not > # converting them to methods. This is intended. > encode = codecs.readbuffer_encode > decode = codecs.latin_1_decode What's the point

[issue8838] Remove codecs.readbuffer_encode() and codecs.charbuffer_encode()

2010-05-28 Thread Éric Araujo
Éric Araujo added the comment: I’d be grateful if someone could post links to discussion about the removal of codecs like hex and rot13 and about their coming back. It may be useful for a NEWS entry too, not just for my personal curiosity ;) I’ll try to find them next week or so if nobody pos

[issue8838] Remove codecs.readbuffer_encode() and codecs.charbuffer_encode()

2010-05-28 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Antoine Pitrou wrote: > > Antoine Pitrou added the comment: > >> Any Python object can expose a buffer interface and the above >> functions then allow accessing these interfaces from within >> Python. > > What's the point? The codecs functions already su

[issue8838] Remove codecs.readbuffer_encode() and codecs.charbuffer_encode()

2010-05-28 Thread Antoine Pitrou
Antoine Pitrou added the comment: > Any Python object can expose a buffer interface and the above > functions then allow accessing these interfaces from within > Python. What's the point? The codecs functions already support objects exposing the buffer interface: >>> b = b"\xe9" >>> codecs.la

[issue8838] Remove codecs.readbuffer_encode() and codecs.charbuffer_encode()

2010-05-28 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: STINNER Victor wrote: > > STINNER Victor added the comment: > >> Those two encoder functions were meant to be used by Python codec >> implementations which want to use the readbuffer and charbuffer >> interfaces available in Python via "s#" and "t#" to ac

[issue8838] Remove codecs.readbuffer_encode() and codecs.charbuffer_encode()

2010-05-28 Thread STINNER Victor
STINNER Victor added the comment: > Those two encoder functions were meant to be used by Python codec > implementations which want to use the readbuffer and charbuffer > interfaces available in Python via "s#" and "t#" to access input > object data. Ah ok. > They are not used by the builtin co

[issue8838] Remove codecs.readbuffer_encode() and codecs.charbuffer_encode()

2010-05-28 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: STINNER Victor wrote: > > New submission from STINNER Victor : > > readbuffer_encode() and charbuffer_encode() are not really encoder nor > related to encodings: they are related to PyBuffer. readbuffer_encode() uses > "s#" format and charbuffer_encode()

[issue8838] Remove codecs.readbuffer_encode() and codecs.charbuffer_encode()

2010-05-27 Thread STINNER Victor
STINNER Victor added the comment: A search in Google doesn't show anything interesting: it looks like these functions were never used outside Python test suite. I just noticed r41461: "Add tests for various error cases and for readbuffer_encode() and charbuffer_encode(). This increases code co

[issue8838] Remove codecs.readbuffer_encode() and codecs.charbuffer_encode()

2010-05-27 Thread STINNER Victor
New submission from STINNER Victor : readbuffer_encode() and charbuffer_encode() are not really encoder nor related to encodings: they are related to PyBuffer. readbuffer_encode() uses "s#" format and charbuffer_encode() uses "t#" format to parse their arguments. Both functions were introduced