Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(8)

#15958: bytes.join() should allow arbitrary buffer objects

Can't Edit
Can't Publish+Mail
Start Review
Created:
7 years, 4 months ago by pitrou
Modified:
7 years, 3 months ago
Reviewers:
storchaka
CC:
AntoinePitrou, glyph_twistedmatrix.com, ezio.melotti, Arfrever, skrah, devnull_psf.upfronthosting.co.za, storchaka
Visibility:
Public.

Patch Set 1 #

Patch Set 2 #

Total comments: 3

Patch Set 3 #

Patch Set 4 #

Total comments: 3

Patch Set 5 #

Patch Set 6 #

Total comments: 2

Patch Set 7 #

Total comments: 7
Unified diffs Side-by-side diffs Delta from patch set Stats Patch
Lib/test/test_bytes.py View 1 2 3 4 5 6 2 chunks +21 lines, -2 lines 0 comments Download
Objects/bytearrayobject.c View 1 2 3 4 5 6 3 chunks +4 lines, -66 lines 0 comments Download
Objects/bytesobject.c View 1 2 3 4 5 6 4 chunks +15 lines, -90 lines 0 comments Download
Objects/stringlib/join.h View 1 2 3 4 5 6 1 chunk +122 lines, -0 lines 7 comments Download

Messages

Total messages: 7
storchaka_gmail.com
This patch looks better. http://bugs.python.org/review/15958/diff/6038/Objects/bytesobject.c File Objects/bytesobject.c (right): http://bugs.python.org/review/15958/diff/6038/Objects/bytesobject.c#newcode1149 Objects/bytesobject.c:1149: if (!PyObject_CheckBuffer(item)) { I think ...
7 years, 4 months ago #1
storchaka_gmail.com
http://bugs.python.org/review/15958/diff/6259/Objects/bytearrayobject.c File Objects/bytearrayobject.c (right): http://bugs.python.org/review/15958/diff/6259/Objects/bytearrayobject.c#newcode2625 Objects/bytearrayobject.c:2625: "join() result is too long for bytes"); ...for bytearray? ...
7 years, 3 months ago #2
storchaka_gmail.com
http://bugs.python.org/review/15958/diff/6285/Objects/bytesobject.c File Objects/bytesobject.c (right): http://bugs.python.org/review/15958/diff/6285/Objects/bytesobject.c#newcode1167 Objects/bytesobject.c:1167: for (i = 0, nbufs = 0; i < ...
7 years, 3 months ago #3
AntoinePitrou
http://bugs.python.org/review/15958/diff/6285/Objects/bytesobject.c File Objects/bytesobject.c (right): http://bugs.python.org/review/15958/diff/6285/Objects/bytesobject.c#newcode1167 Objects/bytesobject.c:1167: for (i = 0, nbufs = 0; i < ...
7 years, 3 months ago #4
storchaka_gmail.com
http://bugs.python.org/review/15958/diff/6291/Objects/stringlib/join.h File Objects/stringlib/join.h (right): http://bugs.python.org/review/15958/diff/6291/Objects/stringlib/join.h#newcode3 Objects/stringlib/join.h:3: #if STRINGLIB_SIZEOF_CHAR != 1 I think bytes_join has not ...
7 years, 3 months ago #5
AntoinePitrou
http://bugs.python.org/review/15958/diff/6291/Objects/stringlib/join.h File Objects/stringlib/join.h (right): http://bugs.python.org/review/15958/diff/6291/Objects/stringlib/join.h#newcode3 Objects/stringlib/join.h:3: #if STRINGLIB_SIZEOF_CHAR != 1 On 2012/10/16 20:28:53, storchaka wrote: ...
7 years, 3 months ago #6
storchaka_gmail.com
7 years, 3 months ago #7
http://bugs.python.org/review/15958/diff/6291/Objects/stringlib/join.h
File Objects/stringlib/join.h (right):

http://bugs.python.org/review/15958/diff/6291/Objects/stringlib/join.h#newcode20
Objects/stringlib/join.h:20: Py_buffer static_buffers[NB_STATIC_BUFFERS];
On 2012/10/16 20:32:10, AntoinePitrou wrote:
> On 2012/10/16 20:28:53, storchaka wrote:
> > Non-reentrant.
> > 
> > If _getbuffer can run user code, then STRINGLIB(bytes_join) can be called
> > recursively.
> > 
> > I think a special flag static_buffers_in_use is enough.
> 
> Despite its name, static_buffers is not "static" in the C sense, it's
> stack-allocated, so recursive calls should be fine.

You are right.
Sign in to reply to this message.

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+