Commit Graph

18 Commits

Author SHA1 Message Date
Maarten ter Huurne
32ee49c79c Add zipfile.ZipFile.filename (#3104) 2019-07-25 11:26:39 +02:00
Michael Lee
efb67946f8 Use variable annotations everywhere (#2909) 2019-04-13 10:40:52 +02:00
Michael J. Sullivan
f343150a6d Make ZipFile.NameToInfo use Text as the key type (#2736)
This makes it match ZipInfo.filename and also actual behavior.
2019-01-10 20:32:18 -06:00
Alex Sarkesian
893089d143 Add stubs to classes in zipfile to better enable subclassing (#2707) 2019-01-05 10:43:26 -08:00
Maxim Kurnikov
172b384e23 zipfile.ZipInfo.__init__ is the same on 2/3 (#2628) 2018-11-23 18:46:57 -08:00
PRAJWAL M
b33738e042 Add is_dir method to ZipInfo class (#2554) 2018-10-25 17:55:39 +02:00
tikki
5a1ea5efb2 Minor fixes for zipfile (#2360)
* Add `is_dir` to `ZipFile`

* Allow `pathlib.Path` for `is_zipfile`
2018-08-06 09:48:53 -07:00
strager
e404bc7cd6 Allow pathlib.Path in zipfile.ZipFile (#2238)
`zipfile.ZipFile` is typed to accept `Text` for local and archive file
paths. In Python 3.6, several `ZipFile` methods accept `pathlib.Path`
objects, not just `str` objects. Generalize `ZipFile`'s methods so code
using `pathlib.Path` with `ZipFile` type-checks.

I verified (using my own project) that the following methods work with
os.PurePath at runtime on CPython 3.6:

* zipfile.ZipInfo.__init__
* zipfile.ZipInfo.extractall
* zipfile.ZipInfo.write
2018-06-18 08:29:23 -07:00
Jelle Zijlstra
37aba00fe8 fix using ZipFile as a ContextManager (#2043) 2018-04-12 12:29:22 -07:00
Josh Holland
162d884d32 Make zipfile accept Text, not str (#1826) 2018-03-17 22:33:29 -07:00
Salvo 'LtWorf' Tomaselli
c8c4a8f208 Added filelist attribute to ZipFile (#1798) 2018-01-02 10:18:03 -08:00
Jelle Zijlstra
6f6fa428ce fix some issues found by stubcheck (#1303)
- ThreadError exists (undocumented) on Python 3. It's an alias for _thread.error,
  but making it a separate exception seems fine.
- zipfile.error is an alias for BadZipFile on both Python versions.
- zlib.Compress and Decompress are not actually accessible at runtime.
2017-05-23 12:44:35 -07:00
Lukasz Langa
5f416fae64 Add missing List imports. 2016-12-21 01:06:52 -08:00
David Percy
9fa6c994a3 Fix zipfile getinfo return type (#678) 2016-11-10 11:08:57 -08:00
Guido van Rossum
47f2746526 Fix the definitions of BadZip{f,F}ile. (#432)
In 2.7, only BadZipfile exists. In 3.x, both exist.
2016-08-02 09:04:45 -07:00
Guido van Rossum
39325bf159 Mypy now supports sys.platform and sys.version_info checks (#410) 2016-07-27 13:25:29 -07:00
alvarocaceres
f7b35bc8be Remove line continuations to help pytype parse (#390) 2016-07-22 10:55:42 -07:00
Valérian Rousset
8ef221c162 add zipfile for py2 (#345) 2016-07-15 05:55:20 -07:00