[issue5863] bz2.BZ2File should accept other file-like objects. (issue4274045)

2011-04-07 Thread Jesús Cea Avión
Changes by Jesús Cea Avión : -- nosy: +jcea ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.o

[issue5863] bz2.BZ2File should accept other file-like objects. (issue4274045)

2011-04-03 Thread Éric Araujo
Éric Araujo added the comment: As a new feature, this can’t go into older versions. -- ___ Python tracker ___ ___ Python-bugs-list mai

[issue5863] bz2.BZ2File should accept other file-like objects. (issue4274045)

2011-04-03 Thread Oliver Deppert
Oliver Deppert added the comment: Hi, thanks for the patch. Could you also publish a version for older python 2.x ? regards, Olli -- nosy: +Kontr-Olli ___ Python tracker ___ __

[issue5863] bz2.BZ2File should accept other file-like objects. (issue4274045)

2011-04-03 Thread Antoine Pitrou
Antoine Pitrou added the comment: Thank you very much, Nadeem. The patch is now in. -- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed ___ Python tracker _

[issue5863] bz2.BZ2File should accept other file-like objects. (issue4274045)

2011-04-03 Thread Roundup Robot
Roundup Robot added the comment: New changeset 2cb07a46f4b5 by Antoine Pitrou in branch 'default': Issue #5863: Rewrite BZ2File in pure Python, and allow it to accept http://hg.python.org/cpython/rev/2cb07a46f4b5 -- nosy: +python-dev ___ Python track

[issue5863] bz2.BZ2File should accept other file-like objects. (issue4274045)

2011-04-02 Thread Nadeem Vawda
Nadeem Vawda added the comment: ... and the corresponding updated documentation patch. -- Added file: http://bugs.python.org/file21508/bz2-v6-doc.diff ___ Python tracker ___

[issue5863] bz2.BZ2File should accept other file-like objects. (issue4274045)

2011-04-02 Thread Nadeem Vawda
Nadeem Vawda added the comment: Here's the updated patch. -- Added file: http://bugs.python.org/file21507/bz2-v6.diff ___ Python tracker ___ _

[issue5863] bz2.BZ2File should accept other file-like objects. (issue4274045)

2011-04-02 Thread Antoine Pitrou
Antoine Pitrou added the comment: > The tests for readline() and readlines() expect a TypeError if size is None. > Calling size.__index__() in this case raises an AttributeError instead. > Should I > change the tests to expect an AttributeError? Alternatively, something like > this > would mor

[issue5863] bz2.BZ2File should accept other file-like objects. (issue4274045)

2011-04-02 Thread Nadeem Vawda
Nadeem Vawda added the comment: Thanks for the review. I've made most of the changes you suggested, but there's one thing I wanted to check about: > - instead of "int(size)", use "size = size.__index__()" so as to forbid floats The tests for readline() and readlines() expect a TypeError if siz

[issue5863] bz2.BZ2File should accept other file-like objects. (issue4274045)

2011-04-02 Thread Antoine Pitrou
Antoine Pitrou added the comment: > Here is an updated patch that adds read1() to BZ2File. This should fix things > for issue10791 from the bz2 side. I also took the opportunity to clean up > _read_block() to be more readable. As per Martin's suggestion on python-dev, I > put the copyright notic

[issue5863] bz2.BZ2File should accept other file-like objects. (issue4274045)

2011-04-02 Thread Nadeem Vawda
Nadeem Vawda added the comment: Updated documentation. -- Added file: http://bugs.python.org/file21503/bz2-v5-doc.diff ___ Python tracker ___

[issue5863] bz2.BZ2File should accept other file-like objects. (issue4274045)

2011-04-02 Thread Nadeem Vawda
Nadeem Vawda added the comment: Here is an updated patch that adds read1() to BZ2File. This should fix things for issue10791 from the bz2 side. I also took the opportunity to clean up _read_block() to be more readable. As per Martin's suggestion on python-dev, I put the copyright notice in the p

[issue5863] bz2.BZ2File should accept other file-like objects. (issue4274045)

2011-03-30 Thread Nadeem Vawda
Nadeem Vawda added the comment: > Apparently the PSF has received your contributor agreement. Great; I was just about to send them an email to check. > Does it mean the situation is cleared? I plan to do a review of your latest > patch. Yes, everything's sorted out. Go ahead :) --

[issue5863] bz2.BZ2File should accept other file-like objects. (issue4274045)

2011-03-30 Thread Antoine Pitrou
Antoine Pitrou added the comment: Nadeem, > Can I ask that you not commit this > patch until the CA has been submitted? I will need to clear it with my > employer, and it might complicate things if the code in question has > already been committed. Apparently the PSF has received your contribu

[issue5863] bz2.BZ2File should accept other file-like objects. (issue4274045)

2011-03-23 Thread Andrew Svetlov
Changes by Andrew Svetlov : -- nosy: +asvetlov ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pytho

[issue5863] bz2.BZ2File should accept other file-like objects. (issue4274045)

2011-03-21 Thread Antoine Pitrou
Antoine Pitrou added the comment: > >From the discussion on python-dev, it seems that I will need to submit a > Contributor Agreement to the PSF. Can I ask that you not commit this > patch until the CA has been submitted? I will need to clear it with my > employer, and it might complicate things

[issue5863] bz2.BZ2File should accept other file-like objects. (issue4274045)

2011-03-21 Thread Nadeem Vawda
Nadeem Vawda added the comment: >From the discussion on python-dev, it seems that I will need to submit a Contributor Agreement to the PSF. Can I ask that you not commit this patch until the CA has been submitted? I will need to clear it with my employer, and it might complicate things if the co

[issue5863] bz2.BZ2File should accept other file-like objects. (issue4274045)

2011-03-20 Thread Nadeem Vawda
Nadeem Vawda added the comment: Corresponding patch for the module docs. -- Added file: http://bugs.python.org/file21315/bz2-v4-doc.diff ___ Python tracker ___ __

[issue5863] bz2.BZ2File should accept other file-like objects. (issue4274045)

2011-03-20 Thread Nadeem Vawda
Nadeem Vawda added the comment: Here is an updated patch, incorporating the feedback from your review. The new patch no longer checks for errors in bz2CompressEnd()/bz2DecompressEnd() in the dealloc functions for BZ2Compressor/BZ2Decompressor. I found that calling PyErr_WriteUnraisable() result

[issue5863] bz2.BZ2File should accept other file-like objects. (issue4274045)

2011-03-19 Thread Antoine Pitrou
Antoine Pitrou added the comment: Given the absence of response on python-dev, I'd say simply remove the obsolete copyright notice. -- ___ Python tracker ___ ___

[issue5863] bz2.BZ2File should accept other file-like objects. (issue4274045)

2011-03-14 Thread Nadeem Vawda
Nadeem Vawda added the comment: > Well, I would personally advocate not re-adding a license boilerplate, > since it doesn't serve a purpose (nearly all of Python is freely usable > under the PSF License, and the authors are documented by version control). That sounds sensible to me. I'll see wh

[issue5863] bz2.BZ2File should accept other file-like objects. (issue4274045)

2011-03-14 Thread Antoine Pitrou
Antoine Pitrou added the comment: > Regarding the use of PY_SSIZE_T_CLEAN, I assume that Py_ssize_t is to be > preferred over plain ssize_t. Is this correct? Yes, ssize_t doesn't exist everywhere AFAIK. (size_t does, or at least we assume it does) > Also, I was wondering whether I need to add

[issue5863] bz2.BZ2File should accept other file-like objects. (issue4274045)

2011-03-14 Thread Nadeem Vawda
Nadeem Vawda added the comment: > Would it be possible to add an open() function to the bz2 module? Yes, it would be quite trivial, though I don't think it would be worthwhile - all it would do is provide a direct alias for the BZ2File constructor. But as Antoine said, that is a topic for a sep

[issue5863] bz2.BZ2File should accept other file-like objects. (issue4274045)

2011-03-14 Thread Antoine Pitrou
Antoine Pitrou added the comment: > Would it be possible to add an open() function to the bz2 module? > Currently gzip has such a function, but bz2 does not: Well, it could be a topic for a separate issue. -- ___ Python tracker

[issue5863] bz2.BZ2File should accept other file-like objects. (issue4274045)

2011-03-14 Thread Michiel de Hoon
Michiel de Hoon added the comment: Would it be possible to add an open() function to the bz2 module? Currently gzip has such a function, but bz2 does not: >>> import gzip >>> gzip.open >>> import bz2 >>> bz2.open Traceback (most recent call last): File "", line 1, in ? AttributeError: 'modu

[issue5863] bz2.BZ2File should accept other file-like objects. (issue4274045)

2011-03-13 Thread Nadeem Vawda
Nadeem Vawda added the comment: Thanks for the review. I'll try and have an updated patch ready by next weekend. Regarding your comments: > Is there any reason it doesn't inherit io.BufferedIOBase? No, there isn't; I'll fix that in my revised patch. > Since this is a new start, perhaps we sho

[issue5863] bz2.BZ2File should accept other file-like objects. (issue4274045)

2011-03-13 Thread Antoine Pitrou
Antoine Pitrou added the comment: Reviewers: nadeem vawda , http://codereview.appspot.com/4274045/diff/1/Lib/bz2.py File Lib/bz2.py (right): http://codereview.appspot.com/4274045/diff/1/Lib/bz2.py#newcode25 Lib/bz2.py:25: class BZ2File: Is there any reason it doesn't inherit io.BufferedIOBase?