-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upload tarfile file-like objects as data attributes #6747
Conversation
This is ready to go, and this fix is in production for my project. I would appreciate it anyone would review it. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #6747 +/- ##
=======================================
Coverage 98.26% 98.26%
=======================================
Files 107 107
Lines 34175 34217 +42
Branches 4054 4058 +4
=======================================
+ Hits 33583 33625 +42
Misses 418 418
Partials 174 174
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Sorry about the delay, this looks good to me. |
Backport to 3.10: 💔 cherry-picking failed — conflicts found❌ Failed to cleanly apply 7681235 on top of patchback/backports/3.10/768123537ec988ea629a829623e8d72e7aec1c41/pr-6747 Backporting merged PR #6747 into master
🤖 @patchback |
Backport to 3.11: 💔 cherry-picking failed — conflicts found❌ Failed to cleanly apply 7681235 on top of patchback/backports/3.11/768123537ec988ea629a829623e8d72e7aec1c41/pr-6747 Backporting merged PR #6747 into master
🤖 @patchback |
(cherry picked from commit 7681235)
(cherry picked from commit 7681235)
(cherry picked from commit 7681235) Co-authored-by: Xavier Halloran <[email protected]>
(cherry picked from commit 7681235) Co-authored-by: Xavier Halloran <[email protected]>
What do these changes do?
Bugfix to allow for file-like objects from Tarfile's file-like objects.
Why is this not simply fixed in
tarfile
in CPython? See the two year old pending PR: python/cpython#82753 Note also that this pending PR will change the exception from AttributeError to io.UnsupportedOperation, when the other io.IOBase objects all raise IOError; should consider monitoring for all three variants of the exception.See also this eight year old conversation that indicates this would technically be an API change to allow
fileno
to raise an IOError instead of an AttributeError. https://bugs.python.org/issue22208Because it may be API change, this fix, if accepted today, would not be available until Python 3.13.
Are there changes in behavior for the user?
The only change that should happen is that tarfile works correctly for file-like objects. No other pytest fails. There are no other known file-like objects that behave in this way, so far.
Related issue number
Fixes #6732