summaryrefslogtreecommitdiff
path: root/Modules/zipimport.c
Commit message (Collapse)AuthorAgeFilesLines
* bpo-32248 - Implement `ResourceReader` and `get_resource_reader()` for ↵Barry Warsaw2018-01-241-0/+30
| | | | zipimport (#5248)
* closes bpo-31650: PEP 552 (Deterministic pycs) implementation (#4575)Benjamin Peterson2017-12-091-3/+13
| | | | | | | | | | | | | | | | | | | | | | | | | 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/+18
| | | | zipimport.zipimporter object (GH-3986)
* bpo-31723: Fix refleaks when zipimporter.__init__() is called more than once ↵Oren Milman2017-10-091-5/+6
| | | | (GH-3919)
* bpo-31602: Fix an assertion failure in zipimporter.get_source() in case of a ↵Oren Milman2017-09-291-0/+8
| | | | | | | 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-30860: Consolidate stateful runtime globals. (#3397)Eric Snow2017-09-071-0/+1
| | | | | | | * group the (stateful) runtime globals into various topical structs * consolidate the topical structs under a single top-level _PyRuntimeState struct * add a check-c-globals.py script that helps identify runtime globals Other globals are excluded (see globals.txt and check-c-globals.py).
* bpo-31291: Fixed an assertion failure in zipimport.zipimporter.get_data() ↵Oren Milman2017-08-291-1/+2
| | | | | (#3226) if pathname.replace('/', '\\') returns non-string.
* bpo-31109: Convert zipimport to use Argument Clinic (GH-2990)Yaron de Leeuw2017-08-181-160/+170
|
* bpo-30592: Fixed error messages for some builtins. (#1996)Serhiy Storchaka2017-06-081-1/+1
| | | | | Error messages when pass keyword arguments to some builtins that don't support keyword arguments contained double parenthesis: "()()". The regression was introduced by bpo-30534.
* bpo-30022: Get rid of using EnvironmentError and IOError (except test… (#1051)Serhiy Storchaka2017-04-161-3/+3
|
* bpo-29770: remove outdated PYO related info (GH-590)Xiang Zhang2017-03-111-3/+3
|
* Issue #28999: Use Py_RETURN_NONE, Py_RETURN_TRUE and Py_RETURN_FALSE whereverSerhiy Storchaka2017-01-231-6/+3
| | | | possible. Patch is writen with Coccinelle.
* Issue #28152: Fix -Wunreachable-code warning on clangVictor Stinner2016-12-051-5/+5
| | | | | Replace C if() with precompiler #if to fix a warning on dead code when using clang.
* Issue #28410: Added _PyErr_FormatFromCause() -- the helper for raisingSerhiy Storchaka2016-10-211-4/+2
| | | | | | | | new exception with setting current exception as __cause__. _PyErr_FormatFromCause(exception, format, args...) is equivalent to Python raise exception(format % args) from sys.exc_info()[1]
* Issue #28131: Fix a regression in zipimport's compile_source()Berker Peksag2016-09-141-1/+1
| | | | zipimport should use the same optimization level as the interpreter.
* Issue #25758: Prevents zipimport from unnecessarily encoding a filename ↵Steve Dower2016-09-091-10/+4
| | | | (patch by Eryk Sun)
* Issue #27895: Spelling fixes (Contributed by Ville Skyttä).Martin Panter2016-09-071-1/+1
|
* Issue #26200: Added Py_SETREF and replaced Py_XSETREF with Py_SETREFSerhiy Storchaka2016-04-101-1/+1
| | | | in places where Py_DECREF was used.
* Issue #22570: Renamed Py_SETREF to Py_XSETREF.Serhiy Storchaka2016-04-061-1/+1
|
* Issue #19883: Fixed possible integer overflows in zipimport.Serhiy Storchaka2016-01-281-153/+214
|
* merge 3.4Benjamin Peterson2016-01-211-0/+4
|\
| * reject negative data_sizeBenjamin Peterson2016-01-211-0/+4
| |
* | merge 3.4 (#26171)Benjamin Peterson2016-01-201-0/+5
|\ \ | |/
| * prevent buffer overflow in get_data (closes #26171)Benjamin Peterson2016-01-201-0/+5
| |
* | merge 3.4Benjamin Peterson2016-01-201-0/+1
|\ \ | |/
| * fix refleak in error conditionBenjamin Peterson2016-01-201-0/+1
| |
* | Issue #17633: Improve support for namespace packages with zipimport.Brett Cannon2016-01-151-16/+32
| | | | | | | | | | | | | | | | | | 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 #20440: Massive replacing unsafe attribute setting code with specialSerhiy Storchaka2015-12-241-2/+1
| | | | | | | | macro Py_SETREF.
* | Issue #23731: Implement PEP 488.Brett Cannon2015-04-131-15/+2
| | | | | | | | | | | | 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: Chain ZipImportError to the OSErrorVictor Stinner2015-03-201-1/+5
| |
* | Issue #19428: Handle PyMarshal_Read*() errors in run_pyc_file()Victor Stinner2015-03-181-0/+3
| | | | | | | | Detect also earlier PyMarshal_Read*() errors in zipimport.
* | Issue #23694: Enhance _Py_fopen(), it now raises an exception on errorVictor Stinner2015-03-181-6/+2
|/ | | | | * If fopen() fails, OSError is raised with the original filename object. * The GIL is now released while calling fopen()
* Issue #23446: Use PyMem_New instead of PyMem_Malloc to avoid possible integerSerhiy Storchaka2015-02-161-1/+1
| | | | overflows. Added few missed PyErr_NoMemory().
* merge backout for #20621Benjamin Peterson2014-02-161-236/+48
|
* merge 3.3Benjamin Peterson2014-01-091-3/+1
|\
| * fix zipimport ref leakBenjamin Peterson2014-01-091-3/+1
| |
* | Fixes issue #19081: When a zipimport .zip file in sys.path being imported fromGregory P. Smith2014-01-071-48/+238
|\ \ | |/ | | | | | | | | 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-071-47/+238
| | | | | | | | | | | | 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 #19515: Remove duplicated identifiers in zipimport.cVictor Stinner2013-11-121-6/+4
| |
* | Issue #18408: Fix zipimport, handle PyUnicode_Substring() and get_subname() ↵Victor Stinner2013-10-291-2/+7
| | | | | | | | failures
* | Issue #19428: zipimport now handles errors when reading truncated or invalidVictor Stinner2013-10-291-3/+13
| | | | | | | | ZIP archive.
* | Issue #18571: Implementation of the PEP 446: file descriptors and file handlesVictor Stinner2013-08-281-2/+2
| | | | | | | | | | are now created non-inheritable; add functions os.get/set_inheritable(), os.get/set_handle_inheritable() and socket.socket.get/set_inheritable().
* | Grammatical mistake in a commentBrett Cannon2013-06-201-1/+1
| |
* | Issue #8745: Small speed up zipimport on Windows. Patch by Catalin Iacob.Serhiy Storchaka2013-02-161-9/+18
|/
* MERGE: Closes #15897: zipimport.c doesn't check return value of fseek()Jesus Cea2012-10-031-7/+36
|\
| * Closes #15897: zipimport.c doesn't check return value of fseek()Jesus Cea2012-10-031-7/+36
| |
* | Fixed two memory leaks in make_filename() in zipimport.c. The allocated ↵Christian Heimes2012-09-101-2/+6
| | | | | | | | buffer wasn't cleaned up in two error cases. CID 486832
* | Closes #15737: Fix potential NULL dereference in zipimport.c.Stefan Krah2012-08-201-2/+2
| |
* | capitialize enum membersBenjamin Peterson2012-05-251-17/+17
| |
* | use PyDict_ContainsBenjamin Peterson2012-05-251-3/+3
| |