[issue13815] tarfile.ExFileObject can't be wrapped using io.TextIOWrapper

2012-05-14 Thread Roundup Robot
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset ab6496b98ac4 by Lars Gustäbel in branch 'default': Issue #13815: Resurrect the ExFileObject class. http://hg.python.org/cpython/rev/ab6496b98ac4 -- ___ Python tracker

[issue13815] tarfile.ExFileObject can't be wrapped using io.TextIOWrapper

2012-05-14 Thread Lars Gustäbel
Lars Gustäbel l...@gustaebel.de added the comment: Okay, I close this issue now, as I think the problems are now resolved. -- status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13815

[issue13815] tarfile.ExFileObject can't be wrapped using io.TextIOWrapper

2012-05-10 Thread Lars Gustäbel
Lars Gustäbel l...@gustaebel.de added the comment: Okay, I attached a patch that I hope we can all agree upon. It restores the ExFileObject class as a small subclass of BufferedReader as Amaury suggested. Does the documentation have to be changed, too? It states that an io.BufferedReader

[issue13815] tarfile.ExFileObject can't be wrapped using io.TextIOWrapper

2012-05-10 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: I don't think a doc change is needed. An isinstance check based on the docs will succeed, and the rest is an implementation detail, I think. -- ___ Python tracker rep...@bugs.python.org

[issue13815] tarfile.ExFileObject can't be wrapped using io.TextIOWrapper

2012-05-09 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Well, if it's not documented, it's technically a private API. Also, there doesn't seem to be any explicit use of ExFileObject outside of tarfile.py: http://code.google.com/codesearch#searchq=lang:python+exfileobject -- nosy: +pitrou

[issue13815] tarfile.ExFileObject can't be wrapped using io.TextIOWrapper

2012-05-09 Thread Lars Gustäbel
Lars Gustäbel l...@gustaebel.de added the comment: In an earlier draft of my patch, I had kept ExFileObject as a subclass of BufferedReader, but I later decided against it. To use BufferedReader directly is in my opinion the cleaner solution. I admit that the change is not fully backward

[issue13815] tarfile.ExFileObject can't be wrapped using io.TextIOWrapper

2012-05-09 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: Yeah, I know it is technically private. We still tend to keep names around unless there's a good reason to delete them (like using them leads to broken code anyway). The code search is some evidence this deletion would be OK, but why

[issue13815] tarfile.ExFileObject can't be wrapped using io.TextIOWrapper

2012-05-09 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Yeah, I know it is technically private. We still tend to keep names around unless there's a good reason to delete them (like using them leads to broken code anyway). The code search is some evidence this deletion would be OK, but why *not*

[issue13815] tarfile.ExFileObject can't be wrapped using io.TextIOWrapper

2012-05-09 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: Code search is not proof, I'm afraid. It is evidence, though, and I thought I indicated I thought it was a good argument in favor of dropping the class. -- ___ Python tracker

[issue13815] tarfile.ExFileObject can't be wrapped using io.TextIOWrapper

2012-05-09 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Code search is not proof, I'm afraid. It is evidence, though, and I thought I indicated I thought it was a good argument in favor of dropping the class. Yes, sorry for the vocabulary mismatch :-) --

[issue13815] tarfile.ExFileObject can't be wrapped using io.TextIOWrapper

2012-05-09 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: I came here when I saw this comment in the diff: # Keep the traditional pre-3.3 API intact. Why keep an internal API intact if we do it partially? The ExFileObject class above will also simplify the code: simply return

[issue13815] tarfile.ExFileObject can't be wrapped using io.TextIOWrapper

2012-05-08 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: I think it would have been better to keep the ExFileObject class, and base it on io.BufferedReader: class ExFileObject(io.BufferedReader): def __init__(self, tarfile, tarinfo): raw = _FileInFile(tarfile.fileobj,

[issue13815] tarfile.ExFileObject can't be wrapped using io.TextIOWrapper

2012-05-08 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: Indeed, even though it is not a documented API, our backward compatibility policy pretty much requires that something named ExFileObject still exist, just in case. And in this case it probably should still be the thing returned.

[issue13815] tarfile.ExFileObject can't be wrapped using io.TextIOWrapper

2012-05-05 Thread Roundup Robot
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset 254cb4f5d0ff by Lars Gustäbel in branch 'default': Issue #13815: TarFile.extractfile() now returns io.BufferedReader objects. http://hg.python.org/cpython/rev/254cb4f5d0ff -- nosy: +python-dev

[issue13815] tarfile.ExFileObject can't be wrapped using io.TextIOWrapper

2012-05-05 Thread Lars Gustäbel
Lars Gustäbel l...@gustaebel.de added the comment: I did some tarfile spring cleaning: I removed the ExFileObject class completely as it was more or less a leftover from the old days. io.BufferedReader now does the job. So, as a side-effect, I close this issue as fixed. (BTW, this makes

[issue13815] tarfile.ExFileObject can't be wrapped using io.TextIOWrapper

2012-02-03 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: Please always use explicit roles in reST, i.e. :meth:`flush` instead of `flush` (use ``flush`` when you don’t want a ton of identical links). In the test, using assertEqual instead of assertTrue will certainly give more useful output in case of

[issue13815] tarfile.ExFileObject can't be wrapped using io.TextIOWrapper

2012-01-20 Thread Terry J. Reedy
Terry J. Reedy tjre...@udel.edu added the comment: Based on other examples in the doc, I think the note ... and also supports iteration over its lines. should be extended with It also has a dummy `flush` method, so that it can be wrapped using :class:`io.TextIOWrapper`. Then just add ..

[issue13815] tarfile.ExFileObject can't be wrapped using io.TextIOWrapper

2012-01-18 Thread Colin Watson
New submission from Colin Watson cjwat...@users.sourceforge.net: The file-like object returned by TarFile.extractfile can't be wrapped in an io.TextIOWrapper (which would be rather convenient in some cases to get something that reads str rather than bytes). The attached patch demonstrates the

[issue13815] tarfile.ExFileObject can't be wrapped using io.TextIOWrapper

2012-01-18 Thread Barry A. Warsaw
Changes by Barry A. Warsaw ba...@python.org: -- nosy: +barry ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13815 ___ ___ Python-bugs-list mailing

[issue13815] tarfile.ExFileObject can't be wrapped using io.TextIOWrapper

2012-01-18 Thread Lars Gustäbel
Changes by Lars Gustäbel l...@gustaebel.de: -- assignee: - lars.gustaebel nosy: +lars.gustaebel ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13815 ___