Commit Graph

46 Commits

Author SHA1 Message Date
Avasam
dee4ef3171 Still allow passing None to shutil.rmtree's onerror parameter on Python 3.12+ (#13478)
Resolves https://github.com/python/mypy/issues/18239
2025-02-08 17:46:09 -08:00
Alex Waygood
7fc9d65ee2 Fix false positives from @deprecated for shutil.rmtree (#12116) 2024-06-08 21:27:26 +02:00
Avasam
50cbca413c Make shutil.rmtree.onexc parameter optional (#12002) 2024-05-22 22:41:25 +02:00
Shantanu
2ab710010b shutil: add chown args in py313 (#11973) 2024-05-18 15:09:31 -07: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
Sebastian Rittau
23604858a6 Remove Python 3.7 branches (#11238) 2024-01-05 11:39:39 +01:00
Jit Kanetkar
e2a393897c shutil.pyi: update chown stubs to support file descriptor (#11082)
Per the python docs, `os.chown`, which is directly called by `shutil.chown`, supports "specifying a file descriptor". Currently, this below code works but fails in mypy:

```python
import shutil
import tempfile

with tempfile.TemporaryFile() as file:
    shutil.chown(file.fileno(), group="my_group")
```
2023-11-28 22:22:33 +00: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
a4856c5650 shutil.rmtree: Add onexc parameter; add parameter defaults (#10219) 2023-05-25 23:38:21 -07:00
Shantanu
a4e33d4053 shutil.unpack_archive: update for py312 (#10215)
Add the new "filter" parameter
2023-05-25 09:53:25 +01:00
Alex Waygood
dd2818a41d Stdlib: add container default values (#9909) 2023-03-21 09:12:34 +01: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
Avasam
aad1a14890 Use the FileDescriptorOrPath alias consistently in the stdlib (#9513) 2023-01-12 18:14:48 +00:00
Alex Waygood
c78bc57f78 shutil.rmtree: add avoids_symlink_attacks attribute (#9366) 2022-12-15 09:56:58 +00:00
Alex Waygood
e2ce7c6344 stdlib: audit more callback annotations (#8209) 2022-07-19 07:07:25 -07:00
Alex Waygood
edc0ecd857 Remove Python 3.6 branches from typeshed (#8269) 2022-07-11 10:55:17 +02:00
Alex Waygood
8b3b6bf7cd stdlib: Audit Callable[<parameters>, None] annotations (#8187) 2022-06-27 08:08:28 +02:00
Shantanu
ceda368abc shutil: update rmtree for py311 (#7925) 2022-05-22 15:40:06 -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
97a74bc1aa Import from collections.abc wherever possible (#7635) 2022-04-18 12:50:37 +02:00
Alex Waygood
740193a8fc Use TypeAlias where possible for type aliases (#7630) 2022-04-15 18:01:00 -07:00
Alex Waygood
3ab250eec8 Use PEP 604 syntax wherever possible (#7493) 2022-03-16 16:01:33 +01:00
Jelle Zijlstra
2fb9c35ff9 Put shutil.chown back on Windows (#7446)
See #7384 and https://github.com/python/typeshed/pull/7443#issuecomment-1060071944 (thanks @AlexWaygood for diagnosing).
2022-03-06 16:27:24 -08:00
Martin Fischer
8034c1c48c stdlib: shutil.chown does not work on Windows (#7384) 2022-03-06 16:04:05 -08:00
Alex Waygood
a3bb5af4a0 Add __all__ to most modules beginning with 'q', 'r' and 's' (#7364) 2022-02-22 16:51:54 -08:00
Nikita Sobolev
9854926289 function argument in shutil.register_unpack_format must be Callable (#7083) 2022-01-30 11:29:36 -08:00
Joseph Young
b119ff2717 Fix shutil.copy2 stub (#6875) 2022-01-15 15:20:08 -08:00
Joseph Young
8f7dd8c381 Fix return type of shutil.which (#6867)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2022-01-09 16:29:43 +02:00
Joseph Young
ac623b5036 Support bytes paths in shutil.copy (#6866) 2022-01-09 14:03:26 +02:00
Joseph Young
ea6c562928 Accept bytes in shutil.copymode (#6862) 2022-01-08 20:49:51 +02:00
Joseph Young
0e5a00b97a Add a comment explaining why shutil.move doesn't allow bytes/Pathlike[bytes] args (#6832) 2022-01-08 11:59:02 +02:00
Joseph Young
c78107132c Accept bytes in shutil.copystat (#6836) 2022-01-07 00:32:03 +02:00
Joseph Young
7784c56e11 Accept bytes paths in shutil.copyfile (#6841) 2022-01-07 00:30:31 +02:00
Joseph Young
e504437801 Use StrOrBytesPath in shutil.rmtree (#6835) 2022-01-06 18:22:31 +02:00
Joseph Young
b99e024faf Fix shutil.chown stub (#6833)
Co-authored-by: Akuli <akuviljanen17@gmail.com>
2022-01-05 23:55:36 +02:00
Alex Waygood
5c8e68f0eb Use lowercase set, frozenset and deque where possible (#6346) 2021-11-19 15:05:45 -08:00
Akuli
739cc27cc4 fix shutil.disk_usage() argument type (#6197) 2021-10-25 11:52:04 +02:00
Akuli
994b69ef8f Use lowercase tuple where possible (#6170) 2021-10-14 17:18:19 -07:00
Akuli
ce11072dbe Big diff: use lower-case list and dict (#5888) 2021-08-08 09:26:35 -07:00
Akuli
ee487304d7 Big diff: Use new "|" union syntax (#5872) 2021-08-08 11:05:21 +02:00
Sebastian Rittau
841a365284 Remove compatibility aliases (#5464)
* Remove compatibility aliases

Remove a few instances of Text

Use aliases from _typeshed

* Remove unused imports
2021-05-15 20:49:20 +03:00
Akuli
17dcea4a68 Akuli and srittau: Remove Python 2 branches from Python 3 stubs (#5461)
* run script and do some manual changes (Akuli)

* do the whole thing manually (srittau)

* merge changes (Akuli)

Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
2021-05-15 15:33:39 +03:00
hatal175
fbf21995e3 Various stubtest fixes (#5230) 2021-04-18 09:30:00 -07:00
Ivan Levkivskyi
16ae4c6120 Re-organize directory structure (#4971)
See discussion in #2491

Co-authored-by: Ivan Levkivskyi <ilevkivskyi@dropbox.com>
2021-01-27 12:00:39 +00:00