Berker Peksag added the comment:
Fixed. Thanks for the patch, John.
--
resolution: - fixed
stage: commit review - resolved
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23796
Roundup Robot added the comment:
New changeset 7d722c9049ff by Berker Peksag in branch '3.4':
Issue #23796: peak and read1 methods of BufferedReader now raise ValueError
https://hg.python.org/cpython/rev/7d722c9049ff
New changeset be7636fd6438 by Berker Peksag in branch 'default':
Issue #23796:
Roundup Robot added the comment:
New changeset 41e9d324f10d by Berker Peksag in branch 'default':
Issue #23796: peak and read1 methods of BufferedReader now raise ValueError
https://hg.python.org/cpython/rev/41e9d324f10d
--
nosy: +python-dev
___
John Hergenroeder added the comment:
Wonderful! Thanks for your help, Berker!
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23796
___
___
Berker Peksag added the comment:
23796_fix_with_tests.patch LGTM. I'll apply it this weekend. Thanks for the
patch, John.
--
stage: patch review - commit review
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23796
John Hergenroeder added the comment:
It looks like my contributor form has gone through -- what should my next steps
here be? Thanks!
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23796
John Hergenroeder added the comment:
Thanks!
I submitted my contributor agreement form last week -- is there anything I can
do to improve this patch while I wait for that to process?
--
___
Python tracker rep...@bugs.python.org
John Hergenroeder added the comment:
Thanks for the feedback, Berker!
I've added a test case that closes a buffered reader and then attempts to both
peek and read1 it. I tacked it onto the end of the BufferedReaderTest class in
test_io, but let me know if there's a better place to put it.
STINNER Victor added the comment:
John Hergenroeder added the comment:
my assumption is that a 0-length read on a closed BufferReader should fail,
not return an empty bytestring.
I agree.
--
___
Python tracker rep...@bugs.python.org
Martin Panter added the comment:
New patch with tests looks good to me. The BufferedReaderTest class is a
sensible place for the test.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23796
STINNER Victor added the comment:
I confirm the bug on Python 3.5.0a3+.
Is someone interested to fix buffered_peek() to add a check on the closed state?
--
nosy: +haypo
Added file: http://bugs.python.org/file38735/bug.py
___
Python tracker
Berker Peksag added the comment:
Thanks for the patch, John.
I'm under the impression that the final patch will need to include a test
that confirms the patch worked,
Correct. You could convert the reproducers in msg239445 to a test case.
The patch looks good to me. I think you'll also
John Hergenroeder added the comment:
If no-one else wants it, I'd love to tackle this as my first Python (and OSS in
general) contribution. Attached is a one-line patch that just does a
CHECK_CLOSED call in buffered_peek and is modeled on the pattern in the
buffered_flush function just above.
Changes by Serhiy Storchaka storch...@gmail.com:
--
assignee: serhiy.storchaka - berker.peksag
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23796
___
Changes by Serhiy Storchaka storch...@gmail.com:
--
keywords: +easy
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23796
___
___
Python-bugs-list
Martin Panter added the comment:
Happy to when I get a chance. It should be easy to do, though it is not high on
my priority list because I don’t think the scenario is very important in real
world usage. I only encountered it when testing edge cases in another patch.
--
Serhiy Storchaka added the comment:
Do you want provide a patch Martin?
--
assignee: - serhiy.storchaka
nosy: +serhiy.storchaka
stage: - needs patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23796
Martin Panter added the comment:
Confirmed it does indeed affect the current 3.5 (default) branch.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23796
___
New submission from Martin Panter:
If the BufferedReader object has already been closed, calling peek() can cause
a strange error message or a crash:
$ python3 -bWall
Python 3.4.2 (default, Oct 8 2014, 14:33:30)
[GCC 4.9.1 20140903 (prerelease)] on linux
Type help, copyright, credits or
19 matches
Mail list logo