[issue40049] tarfile cannot extract from stdin
Danijel added the comment: For me, this patch solves my problems. Thank you. -- ___ Python tracker <https://bugs.python.org/issue40049> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue40049] tarfile cannot extract from stdin
Danijel added the comment: Hi, well, it says entity too large. I've attached a smaller one, that throws a similar but slightly different error. (Note: only on the _second_ extraction, it looks like problems with symlinks) You can find larger ones here: https://data.rbfh.de/issue40049/ The typescript*.txt are showing a shell session with two different python versions. (3.4.2 and 3.8.2) -- Added file: https://bugs.python.org/file49003/test.tar ___ Python tracker <https://bugs.python.org/issue40049> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue40049] tarfile cannot extract from stdin
Change by Danijel : -- type: -> crash ___ Python tracker <https://bugs.python.org/issue40049> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue40049] tarfile cannot extract from stdin
New submission from Danijel : Hi, I have the following code: ``` import tarfile import sys tar = tarfile.open(fileobj=sys.stdin.buffer, mode='r|*') tar.extractall("tarout") tar.close() ``` then doing the following on a debian 10 system: ``` $ python -m tarfile -c git.tar /usr/share/doc/git $ python -V Python 3.8.1 $ cat git.tar | python foo.py $ cat git.tar | python foo.py Traceback (most recent call last): File "foo.py", line 5, in tar.extractall("tarout") File "/home/danielt/miniconda3/lib/python3.8/tarfile.py", line 2026, in extractall self.extract(tarinfo, path, set_attrs=not tarinfo.isdir(), File "/home/danielt/miniconda3/lib/python3.8/tarfile.py", line 2067, in extract self._extract_member(tarinfo, os.path.join(path, tarinfo.name), File "/home/danielt/miniconda3/lib/python3.8/tarfile.py", line 2139, in _extract_member self.makefile(tarinfo, targetpath) File "/home/danielt/miniconda3/lib/python3.8/tarfile.py", line 2178, in makefile source.seek(tarinfo.offset_data) File "/home/danielt/miniconda3/lib/python3.8/tarfile.py", line 513, in seek raise StreamError("seeking backwards is not allowed") tarfile.StreamError: seeking backwards is not allowed ``` The second extraction trys to seek, although the mode is 'r|*'. For reference if I remove ".buffer" from the code above, I can run it with python2 without problems: ``` $ cat foo2.py import tarfile import sys tar = tarfile.open(fileobj=sys.stdin, mode='r|*') tar.extractall("tarout") tar.close() $ cat git.tar | python2 foo2.py $ cat git.tar | python2 foo2.py $ cat git.tar | python2 foo2.py $ cat git.tar | python2 foo2.py $ cat git.tar | python2 foo2.py ``` -- components: Library (Lib) messages: 364860 nosy: dtamuc priority: normal severity: normal status: open title: tarfile cannot extract from stdin versions: Python 3.8 ___ Python tracker <https://bugs.python.org/issue40049> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11989] deprecate shutil.copy2
New submission from Danijel d...@korn.shell.la: The function name is really ugly. The attached patch introduces an optional parameter to shutil.copy. -- components: Library (Lib) files: shutil.py.diff keywords: patch messages: 135073 nosy: datamuc priority: normal severity: normal status: open title: deprecate shutil.copy2 type: feature request versions: Python 3.4 Added file: http://bugs.python.org/file21876/shutil.py.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11989 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com