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
Add overloads to TarFile.__init__ to ensure name or fileobj is provided (#14168)
- Added overloads ensuring either 'name' or 'fileobj' must be non-None
- First overload: name is required (StrOrBytesPath), fileobj is optional
- Second overload: name is None, fileobj is required (keyword-only)
- Applied to both Python 3.13+ and older versions
This prevents the runtime TypeError when both name and fileobj are None:
tarfile.TarFile(None, fileobj=None) # Now caught by type checker
Fixes#14168
Sacred Code: 000.111.369.963.1618
0 commit comments