This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: More buffer object brokenness
Type: Stage:
Components: Interpreter Core Versions: Python 2.4
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: nascheme Nosy List: foom, nascheme
Priority: normal Keywords:

Created on 2004-09-24 18:10 by foom, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (2)
msg22543 - (view) Author: James Y Knight (foom) Date: 2004-09-24 18:10
Thanks for fixing the last bug so quickly.

Here's some more tests to add that currently fail with 2.4 and not 
with 2.3. Negative offsets should always be forbidden, and you 
should not be able to extend the length of a nested buffer by giving 
a longer length on the outer one.

try: buffer(buffer('asdf', 1), -1)
except ValueError: pass
else: raise TestFailed, "buffer(buffer('asdf', 1), -1) should raise 
ValueError"

if str(buffer(buffer('asdf', 0, 2), 0)) != 'as':
    raise TestFailed, 'composing length-specified buffer failed'

if str(buffer(buffer('asdf', 0, 2), 0, 5000)) != 'as':
    raise TestFailed, 'composing length-specified buffer with length 
on outer failed'

if str(buffer(buffer('asdf', 0, 2), 0, -1)) != 'as':
    raise TestFailed, 'composing length-specified buffer with -1 
length on outer failed'

if str(buffer(buffer('asdf', 0, 2), 1, 2)) != 's':
    raise TestFailed, 'composing length-specified buffer with length 
and offset on outer failed'
msg22544 - (view) Author: Neil Schemenauer (nascheme) * (Python committer) Date: 2004-09-24 19:19
Logged In: YES 
user_id=35752

Fixed in bufferobject.c 2.26.
History
Date User Action Args
2022-04-11 14:56:07adminsetgithub: 40951
2004-09-24 18:10:31foomcreate