Commit Graph

20 Commits

Author SHA1 Message Date
Shantanu
5ecdc08bb1 tarfile: fix arg name (#4326)
And update whitelist since #4322 fixed a thing

Co-authored-by: hauntsaninja <>
2020-07-12 20:27:43 +02:00
Jonathan Slenders
028f0d5293 Fix: TarFile.tarinfo is a Type instead of instance. (#4322)
Co-authored-by: Jonathan Slenders <jslender@cisco.com>
2020-07-10 12:22:04 +02:00
Jelle Zijlstra
0142a87da8 adjust isort config (#4290)
Fixes #4288.

- Default imports to THIRD_PARTY, so in effect we merge the FIRST_PARTY and THIRD_PARTY stubs. This means import order is no longer affected by whether typing_extensions is installed locally.
- Treat typing_extensions, _typeshed and some others as standard library modules.

Note that isort master is very different from the latest release; we'll have to do something
different if and when the next isort release comes out.
2020-06-29 00:00:21 -07:00
Jelle Zijlstra
5d553c9584 apply black and isort (#4287)
* apply black and isort

* move some type ignores
2020-06-28 13:31:00 -07:00
Jelle Zijlstra
43e93f803f use _typeshed's Path aliases (#4214) 2020-06-10 20:57:09 -07:00
Batuhan Taskaya
53ede5967b is_tarfile accepts pathlike (#3804) 2020-05-27 17:21:55 +02:00
karl ding
db14610298 Improve undocumented TarFile method type hints (#4056)
Add type hints for undocumented tarfile.TarFile file methods called via
_extract_member() when extract() is called.
2020-05-23 13:41:07 -07:00
Florian Ludwig
00f5240b88 add more constants to tarfile (#3917) 2020-04-09 14:42:11 +02:00
Michael Lee
b294782183 Make most contextmanager __exit__ signatures return Optional[bool] (#3179)
This pull request is a follow-up to https://github.com/python/mypy/issues/7214.

In short, within that mypy issue, we found it would be helpful to
determine between contextmanagers that can "swallow" exceptions vs ones
that can't. This helps prevent some false positive when using flags that
analyze control flow such as `--warn-unreachable`. To do this,
Jelle proposed assuming that only contextmanagers where the `__exit__`
returns `bool` are assumed to swallow exceptions.

This unfortunately required the following typeshed changes:

1. The typing.IO, threading.Lock, and concurrent.futures.Executor
   were all modified so `__exit__` returns `Optional[None]` instead
   of None -- along with all of their subclasses.

   I believe these three types are meant to be subclassed, so I felt
   picking the more general type was correct.

2. There were also a few concrete types (e.g. see socketserver,
   subprocess, ftplib...) that I modified to return `None` -- I checked
   the source code, and these all seem to return None (and don't appear
   to be meant to be subclassable).

3. contextlib.suppress was changed to return bool. I also double-checked
   the unittest modules and modified a subset of those contextmanagers,
   leaving ones like `_AssertRaisesContext` alone.
2019-08-16 16:13:33 -07:00
Sebastian Rittau
9ccf9356bf Remove Python 3.4 support (#3147)
Closes #3123
2019-07-27 10:58:21 +02:00
Michael Lee
efb67946f8 Use variable annotations everywhere (#2909) 2019-04-13 10:40:52 +02:00
Rebecca Chen
437d8e0ddd Add tarfile.filemode. (#2869)
This function is defined up to Python 3.7 (albeit deprecated in Python 3).
2019-03-16 09:45:01 +01:00
Opal Symes
113eda289f Add context manager to tarfile.TarFile (#2579) 2018-11-02 14:29:37 +01:00
Sebastian Rittau
006a79220f Flake8 fixes (#2549)
* Fix over-indented continuation lines

* Fix under-indented continuation lines

* Fix whitespace around default operator problems

* Limit line lengths

* Fix inconsistent files
2018-10-24 07:20:53 -07:00
Jelle Zijlstra
54ecefef04 removals in Python 3.7 (#2018)
Last part of #1965.
2018-04-06 11:11:29 -07:00
Yusuke Miyazaki
8f476378e0 Update stub for tarfile (#1389) 2017-06-09 06:59:45 -07:00
Teddy Sudol
243b67f0d2 Add compresslevel kwarg to tarfile (#1169)
https://docs.python.org/2/library/tarfile.html?highlight=compresslevel
2017-04-17 15:05:46 -07:00
Lukasz Langa
5b6a9937b2 Fixing flake8 E266 errors 2016-12-20 00:06:36 -08:00
Anders Kaseorg
e13f2c739d Add Iterable base class to tarfile.TarFile (#693)
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2016-11-23 11:49:44 +00:00
Valérian Rousset
1d5b35b2a5 Merge tarfile (#467) 2016-09-03 08:40:45 -07:00