-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
tarfile improvements #5492
tarfile improvements #5492
Conversation
This comment has been minimized.
This comment has been minimized.
1 similar comment
This comment has been minimized.
This comment has been minimized.
GitHub Actions is having issues again. https://www.githubstatus.com/ |
It passes now. |
I need more time to look at this properly, but it feels like a shame if we don't switch |
Good point about this not closing the linked issue. |
To clarify: If I find time to do more, I'd like to do it in a separate PR. And possibly work on |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good apart from one detail
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Diff from mypy_primer, showing the effect of this PR on open source code: poetry (https://github.com/python-poetry/poetry.git)
- poetry/console/commands/self/update.py:234: error: Argument "fileobj" to "TarFile" has incompatible type "GzipFile"; expected "Optional[IO[bytes]]"
|
Literal
formode
.Iterable
.collections.abc
.IO
inTarFile
.More
IO
improvements are possible in the future:_ReadableFileobj
and_WritableFileobj
, depending onmode
.TarFile.bz2open()
and.xzopen()
still useIO
. This depends on improvingbz2.pyi
andlzma.pyi
respectively gaining protocols.TarFile.open()
and module-levelopen()
still useIO
. This could be improved using overloads.IO
.Closes: #5491