[ python-Bugs-1527974 ] tarfile chokes on ipython archive on Windows
SourceForge.net
noreply at sourceforge.net
Tue Jul 25 09:29:51 CEST 2006
Bugs item #1527974, was opened at 2006-07-24 23:00
Message generated for change (Comment added) made by arve_knudsen
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1527974&group_id=5470
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Library
Group: Python 2.4
Status: Open
Resolution: None
Priority: 5
Submitted By: Arve Knudsen (arve_knudsen)
Assigned to: Nobody/Anonymous (nobody)
Summary: tarfile chokes on ipython archive on Windows
Initial Comment:
I'm trying to extract files from the latest ipython tar
archive, available from
http://ipython.scipy.org/dist/ipython-0.7.2.tar.gz,
using tarfile. This is on Windows XP, using Python
2.4.3. There is only a problem if I open the archive in
stream mode (the "mode" argument to tarfile.open is
"r|gz"), in which case tarfile raises StreamError. I'd
be happy if this error could be sorted out.
The following script should trigger the error:
import tarfile
f = file(r"ipython-0.7.2.tar.gz", "rb")
tar = tarfile.open(fileobj=f, mode="r|gz")
try:
for m in tar:
tar.extract(m)
finally:
tar.close()
f.close(
The resulting exception:
Traceback (most recent call last):
File "tst.py", line 7, in ?
tar.extract(m)
File "C:\Program Files\Python24\lib\tarfile.py", line
1335, in extract
self._extract_member(tarinfo, os.path.join(path,
tarinfo.name))
File "C:\Program Files\Python24\lib\tarfile.py", line
1431, in _extract_member
self.makelink(tarinfo, targetpath)
File "C:\Program Files\Python24\lib\tarfile.py", line
1515, in makelink
self._extract_member(self.getmember(linkpath),
targetpath)
File "C:\Program Files\Python24\lib\tarfile.py", line
1423, in _extract_member
self.makefile(tarinfo, targetpath)
File "C:\Program Files\Python24\lib\tarfile.py", line
1461, in makefile
copyfileobj(source, target)
File "C:\Program Files\Python24\lib\tarfile.py", line
158, in copyfileobj
shutil.copyfileobj(src, dst)
File "C:\Program Files\Python24\lib\shutil.py", line
22, in copyfileobj
buf = fsrc.read(length)
File "C:\Program Files\Python24\lib\tarfile.py", line
551, in _readnormal
self.fileobj.seek(self.offset + self.pos)
File "C:\Program Files\Python24\lib\tarfile.py", line
420, in seek
raise StreamError, "seeking backwards is not allowed"
tarfile.StreamError: seeking backwards is not allowed
----------------------------------------------------------------------
>Comment By: Arve Knudsen (arve_knudsen)
Date: 2006-07-25 09:29
Message:
Logged In: YES
user_id=1522083
Well yeah, it appears to be Windows specific. I just tested
on Linux (Ubuntu), also with Python 2.4.3. I'll try 2.4.3+
on Windows to see if it makes any difference. Come to think
of it I think I experienced this problem in that past on
Linux, but then I solved it by repacking ipython. Also, if I
pack it myself on Windows using bsdtar it works fine.
----------------------------------------------------------------------
Comment By: Neal Norwitz (nnorwitz)
Date: 2006-07-25 05:35
Message:
Logged In: YES
user_id=33168
I tested this on Linux with both 2.5 and 2.4.3+ without
problems. I believe there were some fixes in this area.
Could you try testing with the 2.4.3+ current which will
become 2.4.4 (or 2.5b2)? If this is still a problem, it
looks like it may be Windows specific.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1527974&group_id=5470
More information about the Python-bugs-list
mailing list