[issue23796] BufferedReader.peek() crashes if closed
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. I'm under the impression that the final patch will need to include a test that confirms the patch worked, but I wanted to claim the bug and start the feedback process early :) -- keywords: +patch nosy: +jdherg Added file: http://bugs.python.org/file38746/buffered_reader_closed_peek.patch ___ Python tracker <http://bugs.python.org/issue23796> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23796] BufferedReader.peek() crashes if closed
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. I've also added the check to read1 -- good catch. I opted to add it before the check that the argument to read1 is 0 -- my assumption is that a 0-length read on a closed BufferReader should fail, not return an empty bytestring. Thanks again for the feedback! -- Added file: http://bugs.python.org/file38787/23796_fix_with_tests.patch ___ Python tracker <http://bugs.python.org/issue23796> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23796] BufferedReader.peek() crashes if closed
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 <http://bugs.python.org/issue23796> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23796] BufferedReader.peek() crashes if closed
John Hergenroeder added the comment: It looks like my contributor form has gone through -- what should my next steps here be? Thanks! -- ___ Python tracker <http://bugs.python.org/issue23796> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23796] BufferedReader.peek() crashes if closed
John Hergenroeder added the comment: Wonderful! Thanks for your help, Berker! -- ___ Python tracker <http://bugs.python.org/issue23796> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com