Commit Graph

60 Commits

Author SHA1 Message Date
Semyon Moroz 5e0d6ee95e [stdlib] Copy-edit deprecation messages (#14614)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2025-08-21 12:12:00 +01:00
Jelle Zijlstra 02a4b07b54 stdlib: add some parameter defaults (#14610) 2025-08-21 09:17:33 +02:00
Brian Schubert c97c3f0fd0 Update tarfile.TarFile.list to accept any iterable for members (#14455) 2025-07-26 05:25:40 +02:00
Brian Schubert 6b8df6b753 Mark tarfile constants as Final (#14456) 2025-07-26 05:24:09 +02:00
Rogdham 5d881e4be0 Python 3.14: PEP-784 zstd in other modules (#14225) 2025-07-07 13:05:45 +02:00
Brian Schubert 74be9177e9 Fix stdlib stubtest for latest Python patch releases (#14220) 2025-06-05 19:01:31 -07:00
Semyon Moroz 49afeeb806 Add argument to TarInfo.tarfile setter (#13904) 2025-04-29 20:15:16 +02:00
Semyon Moroz 02a9a0e848 Deprecate TarInfo.tarfile attribute (#13894) 2025-04-28 13:41:28 +02:00
Edward Peek bb1cbfab59 Fix incorrect keyword-only arguments in tarfile.open() (#13814) 2025-04-11 11:48:34 +02:00
Sebastian Rittau 30b16c168d Drop Python 3.8 branches (#13776) 2025-04-03 10:35:36 +02:00
Sebastian Rittau 5f1fd23bd2 Rework tarfile.open/TarFile.open (#13177)
* Copy overloads of `open()` to `TarFile.open()`.
* Replace remaining instances of `IO` with `_Fileobj`.
* Replace `open()` with alias to `TarFile.open()` to match implementation.
2025-03-06 13:54:35 +01:00
Sebastian Rittau ba85e0c282 Fix tarfile.open overloads (#13441)
* Allow `compresslevel` argument for modes `w|gz` and `w|bz2`.
* Remove `preset` argument from modes where it's not allowed.

Closes: #13440
2025-03-06 10:39:56 +01:00
Anthony Sottile 101287091c add "w:tar" as a mode for tarfile (#13401) 2025-01-14 17:26:25 +01:00
Colin Watson 7d9f5acebe Allow float for TarInfo.replace(mtime) (#13199) 2024-12-05 14:59:00 +01:00
Konstantin Baikov fcf30cfd40 Fix todo in tarfile for modes with pipe char (#13130) 2024-12-03 13:48:47 +01:00
Colin Watson 1ae7e615c0 Loosen type of fileobj argument to TarFile.addfile (#12961)
It only seems to need something it can read bytes from, rather than a
full-fledged `IO[bytes]`.
2024-11-06 06:10:25 -08:00
Sebastian Rittau 975760281c tarfile.open(): Handle all modes (#12181) 2024-10-02 20:35:56 -07:00
Alyssa Coghlan bed832da8a Allow float for TarInfo.mtime (#12521) 2024-08-13 10:57:21 +02:00
Kanishk Pachauri de22c30fa8 tarfile: fix preset type for tarfile.open (#12193) 2024-06-23 16:08:31 -07:00
Max Muoto 72a85f4c99 Add missing tarfile.open overload for writable objects (#12117) 2024-06-21 11:20:10 +02:00
Amin Alaee b45456739a platform, tarfile, io: Python 3.13 updates (#12056) 2024-05-29 14:37:26 +02:00
Shantanu 470a13ab09 Use PEP 570 syntax in stdlib (#11250) 2024-03-09 14:50:16 -08:00
Jelle Zijlstra c62fedc190 tarfile: Remove @deprecated (#11476)
Fixes #11472.

As noted in the issue, it is possible to set the filter on the class, but that will still cause type checkers to show deprecation warnings. Therefore, we unfortunately cannot enforce this deprecation in the type system.
2024-02-27 06:34:26 -08:00
Jelle Zijlstra bba8cbd6f8 stdlib: more deprecations (#11009)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-02-18 06:50:29 -08:00
Karim Baidar cfb16543b8 Implement Preset Argument in tarfile.open Function and Add Test Coverage (#11251) 2024-01-15 16:39:31 +01:00
Sebastian Rittau 53a8193d64 Update typing_extensions imports in stdlib (#11244)
Co-authored-by: AlexWaygood <alex.waygood@gmail.com>
2024-01-05 08:15:19 -08:00
Sebastian Rittau 23604858a6 Remove Python 3.7 branches (#11238) 2024-01-05 11:39:39 +01:00
Jelle Zijlstra 5beddbe883 Add PEP 706 filters to tarfile (#10316)
Fixes #10315

Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
2023-06-14 15:08:32 +01:00
Alex Waygood 9ed39d8796 Use typing_extensions.Self in the stdlib (#9694) 2023-02-09 09:12:13 +00:00
Alex Waygood a6919227be Add several version-dependent default values to parameters in the stdlib (#9631) 2023-01-31 01:21:39 +00:00
Alex Waygood 33a62ae42d Add more defaults to the stdlib (#9606)
Continuing work towards #8988.

The first five commits were created using stubdefaulter on various Python versions; the following commits were all created manually by me to fix various problems. The main things this adds that weren't present in #9501 are:

- Defaults in Windows-only modules and Windows-only branches (because I'm running a Windows machine)
- Defaults in non-py311 branches
- Defaults for float parameters
- Defaults for overloads
2023-01-29 01:51:23 +00:00
Jelle Zijlstra ddfaca3200 stdlib: add argument default values (#9501) 2023-01-18 09:37:34 +01:00
Nikita Sobolev e68567a1b4 tarfile: improve bytes handling (#9076) 2022-11-03 10:15:46 -07:00
Nikita Sobolev 4905074919 tarfile.TarFile: mark OPEN_METH as a ClassVar (#8725) 2022-09-11 14:32:52 +01:00
Alex Waygood edc0ecd857 Remove Python 3.6 branches from typeshed (#8269) 2022-07-11 10:55:17 +02:00
Adam Simpkins 40d6592ba1 tarfile.gettarinfo() accepts PathLike objects (#7832)
This method has accepted PathLike objects since Python 3.6
(https://github.com/python/cpython/pull/512)
2022-05-11 22:02:04 -07:00
Alex Waygood b093c90a94 Use TypeAlias for type aliases where possible, part II (#7667) 2022-04-20 20:02:47 +01:00
Alex Waygood f4ae363b56 stdlib: correct many pos-or-kw arg names in dunder methods (#7451) 2022-03-07 16:40:03 +01:00
Alex Waygood 6a743348ca Add __all__ for most modules beginning with 't' (#7373) 2022-02-23 18:25:28 -08:00
Alex Waygood 7ccbbdb30a stdlib: Improve many __iter__ and constructor methods (#7112) 2022-02-02 19:14:57 +01:00
Shantanu b88a6f19cd Upgrade black version (#7089) 2022-01-30 16:27:06 -08:00
Alex Waygood 96c9abb058 Always use _typeshed.Self, where applicable (#6880)
* Always use `_typeshed.Self`, where applicable

* Revert changes to `google-cloud-ndb` (ambiguous)

* Remove empty line added by script

* Revert changes to `stubs/python-dateutil/dateutil/relativedelta.pyi`

* Manually add a few more that the script missed

* Improve `filelock` annotation

Source code here: https://github.com/tox-dev/py-filelock/blob/79ec7b2826e33b982fe83b057f359448b9d966ba/src/filelock/_api.py#L207

* Improve `opentracing/scope` annotation

Source code here: https://github.com/opentracing/opentracing-python/blob/3e1d357a348269ef54d67f761302fab93dbfc0f7/opentracing/scope.py#L71

* Improve `redis/client` stub

Source code here: https://github.com/redis/redis-py/blob/15f315a496c3267c8cbcc6d6d9c6005ea4d4a4d5/redis/client.py#L1217

* Improve `redis/lock` annotation

Source code here: https://github.com/redis/redis-py/blob/15f315a496c3267c8cbcc6d6d9c6005ea4d4a4d5/redis/lock.py#L155

* Improve `requests/models` annotation

Source code here: https://github.com/psf/requests/blob/d718e753834b84018014a23d663369ac27d1ab9c/requests/models.py#L653
2022-01-09 19:16:19 -08:00
Alex Waygood a40d79a4e6 Use lowercase type everywhere (#6853) 2022-01-08 16:09:29 +01:00
Alex Waygood 8d5d2520ac Use PEP 585 syntax wherever possible (#6717) 2021-12-28 11:31:43 +01:00
Alex Waygood 5c8e68f0eb Use lowercase set, frozenset and deque where possible (#6346) 2021-11-19 15:05:45 -08:00
Akuli 9af9cca7f3 lowercase list and dict in the rest of stdlib (#5892) 2021-08-09 00:13:08 +02:00
Akuli ee487304d7 Big diff: Use new "|" union syntax (#5872) 2021-08-08 11:05:21 +02:00
Jon Dufresne b2e429cd41 Add typing for TarFile._extract_member method (#5841)
Refs: #2673
2021-08-03 08:53:35 +02:00
Anton Grübel 8a107464a8 Use _typeshed.Self with __enter__ (#5719) 2021-07-01 23:15:13 +02:00
Dominic Davis-Foster 48a346920b Use a TypeVar for the return types of TarFile classmethods. (#5602)
* Use a TypeVar for the return types of TarFile classmethods.

* Add TypeVar annotation to TarFile.__enter__
2021-06-12 10:54:34 +03:00