summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_zipimport.py
Commit message (Collapse)AuthorAgeFilesLines
* bpo-22831: Use "with" to avoid possible fd leaks in tests (part 2). (GH-10929)Serhiy Storchaka2019-03-051-106/+92
|
* bpo-5950: Support reading zips with comments in zipimport (#9548)Zackery Spytz2018-09-251-0/+15
| | | * bpo-5950: Support reading zips with comments in zipimport
* bpo-25711: Remove outdated zipimport tests. (GH-9404)Serhiy Storchaka2018-09-191-49/+0
| | | They were specific to the C implementation.
* bpo-25711: Rewrite zipimport in pure Python. (GH-6809)Serhiy Storchaka2018-09-181-12/+17
|
* closes bpo-31650: PEP 552 (Deterministic pycs) implementation (#4575)Benjamin Peterson2017-12-091-2/+16
| | | | | | | | | | | | | | | | | | | | | | | | | Python now supports checking bytecode cache up-to-dateness with a hash of the source contents rather than volatile source metadata. See the PEP for details. While a fairly straightforward idea, quite a lot of code had to be modified due to the pervasiveness of pyc implementation details in the codebase. Changes in this commit include: - The core changes to importlib to understand how to read, validate, and regenerate hash-based pycs. - Support for generating hash-based pycs in py_compile and compileall. - Modifications to our siphash implementation to support passing a custom key. We then expose it to importlib through _imp. - Updates to all places in the interpreter, standard library, and tests that manually generate or parse pyc files to grok the new format. - Support in the interpreter command line code for long options like --check-hash-based-pycs. - Tests and documentation for all of the above.
* bpo-31781: Prevent crashes when calling methods of an uninitialized ↵Oren Milman2017-10-201-0/+14
| | | | zipimport.zipimporter object (GH-3986)
* bpo-31602: Fix an assertion failure in zipimporter.get_source() in case of a ↵Oren Milman2017-09-291-0/+17
| | | | | | | bad zlib.decompress() (GH-3784) While a rare potential failure (it requires swapping out zlib.decompress() itself and forcing it to return a non-bytes object), this change prevents a potential C-level assertion failure and instead substitutes it with an exception. Thanks to Oren Milman for the patch.
* bpo-31291: Fixed an assertion failure in zipimport.zipimporter.get_data() ↵Oren Milman2017-08-291-0/+17
| | | | | (#3226) if pathname.replace('/', '\\') returns non-string.
* Issue #28131: Merge from 3.5Berker Peksag2016-09-141-0/+13
|\
| * Issue #28131: Fix a regression in zipimport's compile_source()Berker Peksag2016-09-141-0/+13
| | | | | | | | zipimport should use the same optimization level as the interpreter.
* | Issue #25758: Prevents zipimport from unnecessarily encoding a filename ↵Steve Dower2016-09-101-1/+1
|\ \ | |/ | | | | (patch by Eryk Sun)
| * Issue #25758: Prevents zipimport from unnecessarily encoding a filename ↵Steve Dower2016-09-101-1/+1
| | | | | | | | (patch by Eryk Sun)
* | Issue #26754: Undocumented support of general bytes-like objectsSerhiy Storchaka2016-08-061-2/+4
| | | | | | | | as path in compile() and similar functions is now deprecated.
* | Issue #26754: PyUnicode_FSDecoder() accepted a filename argument encoded asSerhiy Storchaka2016-06-181-0/+15
|\ \ | |/ | | | | an iterable of integers. Now only strings and byte-like objects are accepted.
| * Issue #26754: PyUnicode_FSDecoder() accepted a filename argument encoded asSerhiy Storchaka2016-06-181-0/+15
| | | | | | | | an iterable of integers. Now only strings and byte-like objects are accepted.
* | Merge for issue #17633Brett Cannon2016-01-151-32/+216
|\ \ | |/
| * Issue #17633: Improve support for namespace packages with zipimport.Brett Cannon2016-01-151-32/+216
| | | | | | | | | | | | | | | | | | Previously zipimport mistakenly limited namespace support to only the top-level of the zipfile when it should have supported an arbitrary depth. Thanks to Phil Connel for the bug report and initial patch and Mike Romberg for the final patch.
* | Issue #8585: improved tests for zipimporter2. Patch from Mark Lawrence.Robert Collins2015-07-221-1/+20
|/
* Issue #23731: Implement PEP 488.Brett Cannon2015-04-131-1/+1
| | | | | | The concept of .pyo files no longer exists. Now .pyc files have an optional `opt-` tag which specifies if any extra optimizations beyond the peepholer were applied.
* Issue #23696: Remove test on ZipImportError.__context__ because the context isVictor Stinner2015-03-201-1/+0
| | | | | | | | | None on Windows. When the file is not readable, the error occurs at open on UNIX. On Windows, the error only occurs at the first operation on the open file. It would require to many changes to set __context__ to an OSError for all file operations, for a little benefit (__context__ is almost never used).
* Issue #23696: Chain ZipImportError to the OSErrorVictor Stinner2015-03-201-1/+4
|
* merge backout for #20621Benjamin Peterson2014-02-161-85/+19
|\
| * backout 2807a5f011e4 for causing #20621Benjamin Peterson2014-02-161-85/+19
| |
* | Fixes issue #19081: When a zipimport .zip file in sys.path being imported fromGregory P. Smith2014-01-081-19/+85
|\ \ | |/ | | | | | | | | is modified during the lifetime of the Python process after zipimport has already cached the zip's table of contents we detect this and recover rather than read bad data from the .zip (causing odd import errors).
| * Fixes Issue #19081: When a zipimport .zip file in sys.path being imported fromGregory P. Smith2014-01-081-19/+85
| | | | | | | | | | | | is modified during the lifetime of the Python process after zipimport has already cached the zip's table of contents we detect this and recover rather than read bad data from the .zip (causing odd import errors).
* | Issue 19572: More silently skipped tests explicitly skipped.Zachary Ware2013-12-081-1/+1
|\ \ | |/
| * Issue 19572: More silently skipped tests explicitly skipped.Zachary Ware2013-12-081-1/+1
| |
* | Issue #17177: Stop using imp in a bunch of testsBrett Cannon2013-06-151-3/+4
| |
* | Move code from test_importhooks into test_zipimport.Brett Cannon2013-06-121-1/+25
| |
* | Issue #8745: Small speed up zipimport on Windows. Patch by Catalin Iacob.Serhiy Storchaka2013-02-161-0/+2
| |
* | Replace IOError with OSError (#16715)Andrew Svetlov2012-12-251-1/+1
|/
* #8942: add test for __path__ contents in zipimport testsR David Murray2012-03-131-0/+4
| | | | Patch by Tatiana Al-Chueyr.
* Issue #13645: pyc files now contain the size of the corresponding sourceAntoine Pitrou2012-01-131-5/+5
| | | | | code, to avoid timestamp collisions (especially on filesystems with a low timestamp resolution) when checking for freshness of the bytecode.
* Issue #12451: Add support.create_empty_file()Victor Stinner2011-06-301-1/+1
| | | | | | | We don't need to create a temporary buffered binary or text file object just to create an empty file. Replace also os.fdopen(handle).close() by os.close(handle).
* (Merge 3.2) Issue #12124: zipimport doesn't keep a reference toVictor Stinner2011-05-191-17/+0
|\ | | | | | | zlib.decompress() anymore to be able to unload the module.
| * (Merge 3.1) Issue #12124: zipimport doesn't keep a reference toVictor Stinner2011-05-191-17/+0
| |\ | | | | | | | | | zlib.decompress() anymore to be able to unload the module.
| | * Issue #12124: zipimport doesn't keep a reference to zlib.decompress() anymoreVictor Stinner2011-05-191-17/+0
| | | | | | | | | | | | to be able to unload the module.
| | * Merged revisions 86596 via svnmerge fromEzio Melotti2010-11-211-27/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r86596 | ezio.melotti | 2010-11-20 21:04:17 +0200 (Sat, 20 Nov 2010) | 1 line #9424: Replace deprecated assert* methods in the Python test suite. ........
| | * Merged revisions 73715 via svnmerge fromGeorg Brandl2009-08-131-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://svn.python.org/python/branches/py3k ........ r73715 | benjamin.peterson | 2009-07-01 01:06:06 +0200 (Mi, 01 Jul 2009) | 1 line convert old fail* assertions to assert* ........
* | | Refactor a few tests to use the new requires_zlib decorator.Ezio Melotti2011-05-191-7/+1
|/ /
* | #9424: Replace deprecated assert* methods in the Python test suite.Ezio Melotti2010-11-201-27/+27
| |
* | test_zipimport: fix test nameVictor Stinner2010-08-171-1/+1
| |
* | Issue #9425: read_directory() is fully unicode compliantVictor Stinner2010-08-161-0/+14
| | | | | | | | zipimport is now able to load a module with an unencodable filename.
* | PEP 3147Barry Warsaw2010-04-171-20/+19
| |
* | Merged revisions ↵Georg Brandl2010-03-141-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 78018,78035-78040,78042-78043,78046,78048-78052,78054,78059,78075-78080 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r78018 | georg.brandl | 2010-02-06 11:08:21 +0100 (Sa, 06 Feb 2010) | 1 line #7864: make deprecation notices a bit clearer. ........ r78035 | georg.brandl | 2010-02-06 23:44:17 +0100 (Sa, 06 Feb 2010) | 1 line Fix duplicate import. ........ r78036 | georg.brandl | 2010-02-06 23:49:47 +0100 (Sa, 06 Feb 2010) | 1 line Remove unused import. ........ r78037 | georg.brandl | 2010-02-06 23:59:15 +0100 (Sa, 06 Feb 2010) | 1 line No need to assign the results of expressions used only for side effects. ........ r78038 | georg.brandl | 2010-02-07 00:02:29 +0100 (So, 07 Feb 2010) | 1 line Add a missing import. ........ r78039 | georg.brandl | 2010-02-07 00:06:24 +0100 (So, 07 Feb 2010) | 1 line Add missing imports. ........ r78040 | georg.brandl | 2010-02-07 00:08:00 +0100 (So, 07 Feb 2010) | 1 line Fix a few UnboundLocalErrors in test_long. ........ r78042 | georg.brandl | 2010-02-07 00:12:12 +0100 (So, 07 Feb 2010) | 1 line Add missing import. ........ r78043 | georg.brandl | 2010-02-07 00:12:19 +0100 (So, 07 Feb 2010) | 1 line Remove duplicate test method. ........ r78046 | georg.brandl | 2010-02-07 00:18:00 +0100 (So, 07 Feb 2010) | 1 line Fix various missing import/unbound name errors. ........ r78048 | georg.brandl | 2010-02-07 00:23:45 +0100 (So, 07 Feb 2010) | 1 line We heard you like test failures so we put unbound locals in your test so that you can fail while you fail. ........ r78049 | georg.brandl | 2010-02-07 00:33:33 +0100 (So, 07 Feb 2010) | 1 line Fix import/access for some identifiers. _TestSharedCTypes does not seem to be executed? ........ r78050 | georg.brandl | 2010-02-07 00:34:10 +0100 (So, 07 Feb 2010) | 1 line Fix more unbound locals in code paths that do not seem to be used. ........ r78051 | georg.brandl | 2010-02-07 00:53:52 +0100 (So, 07 Feb 2010) | 1 line Add missing import when running these tests standalone. ........ r78052 | georg.brandl | 2010-02-07 00:54:04 +0100 (So, 07 Feb 2010) | 1 line Add missing import when running these tests standalone. ........ r78054 | georg.brandl | 2010-02-07 00:58:25 +0100 (So, 07 Feb 2010) | 1 line Add missing import. ........ r78059 | georg.brandl | 2010-02-07 12:34:15 +0100 (So, 07 Feb 2010) | 1 line Use "regexp" consistently. ........ r78075 | georg.brandl | 2010-02-07 13:16:12 +0100 (So, 07 Feb 2010) | 1 line Fix another duplicated test method. ........ r78076 | georg.brandl | 2010-02-07 13:19:43 +0100 (So, 07 Feb 2010) | 1 line Fix wrong usage of "except X, Y:". ........ r78077 | georg.brandl | 2010-02-07 13:25:50 +0100 (So, 07 Feb 2010) | 1 line Fix two redefined test methods. ........ r78078 | georg.brandl | 2010-02-07 13:27:06 +0100 (So, 07 Feb 2010) | 1 line Fix a redefined test method. ........ r78079 | georg.brandl | 2010-02-07 13:34:26 +0100 (So, 07 Feb 2010) | 1 line Add a minimal test for fnmatchcase(). ........ r78080 | georg.brandl | 2010-02-07 13:55:12 +0100 (So, 07 Feb 2010) | 1 line Remove duplicate test method. ........
* | use assert[Not]In where appropriateBenjamin Peterson2010-01-191-1/+1
| | | | | | | | A patch from Dave Malcolm.
* | Merged revisions 74754 via svnmerge fromEzio Melotti2009-09-121-3/+10
| | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r74754 | ezio.melotti | 2009-09-12 17:43:43 +0300 (Sat, 12 Sep 2009) | 1 line #6026 - fix tests that failed without zlib ........
* | convert old fail* assertions to assert*Benjamin Peterson2009-06-301-2/+2
|/
* Merged revisions 69425 via svnmerge fromNick Coghlan2009-02-081-6/+6
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r69425 | nick.coghlan | 2009-02-08 13:17:00 +1000 (Sun, 08 Feb 2009) | 1 line Issue #4512 closeout: Make ZipImport.get_filename() a public method ........
* Merged revisions 67750-67751 via svnmerge fromNick Coghlan2008-12-141-8/+24
| | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r67750 | nick.coghlan | 2008-12-14 20:54:50 +1000 (Sun, 14 Dec 2008) | 1 line Fix several issues relating to access to source code inside zipfiles. Initial work by Alexander Belopolsky. See Misc/NEWS in this checkin for details. ........ r67751 | nick.coghlan | 2008-12-14 21:09:40 +1000 (Sun, 14 Dec 2008) | 1 line Add file that was missed from r67750 ........