Bugs item #1100429, was opened at 2005-01-11 21:54 Message generated for change (Comment added) made by gustaebel You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1100429&group_id=5470
Category: Python Library Group: Python 2.4 Status: Open Resolution: None Priority: 5 Submitted By: Greg Chapman (glchapman) Assigned to: Nobody/Anonymous (nobody) Summary: TarFile iteration can break (on Windows) if file has links Initial Comment: I ran into this with a simple loop trying to detar Pyrex-0.9.3: for info in tarfile: tarfile.extract(info) I called the above immediately after calling tarfile.open, so the returned iterator was an instance of TarIter. The problem is that Pyrex includes some symbolic links. When TarFile.makelink finds that os.symlink is missing (on Windows) it then does getmember to find the info for the referenced file. The getmember method results in a call to getmembers, which loads all the infos into the members list. However, this breaks the TarIter, since it assumes the members have not yet been loaded. Not sure what the best fix for this is; in my script, I switched over to using getmembers rather than the iterator. ---------------------------------------------------------------------- Comment By: Lars Gustäbel (gustaebel) Date: 2005-01-16 18:40 Message: Logged In: YES user_id=642936 I wrote a patch (#1103407) that should fix this. Thank you for pointing that out. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1100429&group_id=5470 _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com