You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
object returned by tarfile.extractfile has an incorrect value of name attribute #74468
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=Nonecreated_at=<Date2017-05-05.15:09:35.461>labels= ['3.7', 'type-bug', 'library']
title='object returned by tarfile.extractfile has an incorrect value of name attribute'updated_at=<Date2017-05-05.20:36:09.009>user='https://github.com/xondrejk'
Up until 3.2.x, the value of name attribute would be 'FILE' as derived from tarinfo of the member. Starting with 3.3 (commits: b062a2f7a919e9) this value be obtained from tarfile.fileobj ("parent" tarball file) and would return 'tar1.tar.gz' instead.
This does not seem to be correct as it's not a filename of the ExFileObject / _FileInFile / io.BufferedReader object itself which would otherwise be consistent with values normally found under name.
There is also a problem that this information no longer appears to be accessible at all looking at the object returned from extractfile alone.
And looking at release notes of 3.3, this does not seem to be intentional effect.
Activity
xondrejk commentedon May 5, 2017
Consider the following code snippet:
<snip>
import tarfile
Up until 3.2.x, the value of name attribute would be 'FILE' as derived from tarinfo of the member. Starting with 3.3 (commits: b062a2f 7a919e9) this value be obtained from tarfile.fileobj ("parent" tarball file) and would return 'tar1.tar.gz' instead.
This does not seem to be correct as it's not a filename of the ExFileObject / _FileInFile / io.BufferedReader object itself which would otherwise be consistent with values normally found under name.
There is also a problem that this information no longer appears to be accessible at all looking at the object returned from extractfile alone.
And looking at release notes of 3.3, this does not seem to be intentional effect.
gh-74468: [tarfile] Fix incorrect name attribute of ExFileObject (GH-…
pythongh-74468: [tarfile] Fix incorrect name attribute of ExFileObject (