summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_importlib/source
Commit message (Collapse)AuthorAgeFilesLines
* [3.5] bpo-29537: Tolerate legacy invalid bytecode (#169)Nick Coghlan2017-03-081-0/+104
| | | | | | | | | | | | | | | | | | bpo-27286 fixed a problem where BUILD_MAP_UNPACK_WITH_CALL could be emitted with an incorrect oparg value, causing the eval loop to access the wrong stack entry when attempting to read the function name. The associated magic number change caused significant problems when attempting to upgrade to 3.5.3 for anyone that relies on pre-cached bytecode remaining valid across maintenance releases. This patch restores the ability to import legacy bytecode generated by 3.5.0, 3.5.1 or 3.5.2, and modifies the eval loop to avoid any harmful consequences from the potentially malformed legacy bytecode. Original import patch by Petr Viktorin, eval loop patch by Serhiy Storchaka, and tests and integration by Nick Coghlan.
* Fix regressions introduced by fixes for issue #27083.Brett Cannon2016-07-161-10/+3
|
* Issue #27083: Respect the PYTHONCASEOK environment variable underBrett Cannon2016-07-151-6/+9
| | | | | | | | | | Windows. Originally only b'PYTHONCASEOK' was being checked for in os.environ, but that won't work under Windows where all environment variables are strings (on OS X they are bytes). Thanks to Eryk Sun for the bug report.
* Issue #26581: Use the first coding cookie on a line, not the last one.Serhiy Storchaka2016-03-201-1/+1
|
* Issue #23911: Move path-based bootstrap code to a separate frozen module.Eric Snow2015-05-031-2/+2
|
* Closes #22002: Merge with 3.4Zachary Ware2014-07-232-12/+8
|\
| * Issue #22002: Make full use of test discovery in test sub-packages.Zachary Ware2014-07-232-12/+8
| | | | | | | | | | | | Adds `load_package_tests` function to test.support, uses it in test_asyncio, test_email, test_json, test_tools, test_importlib and all test_importlib sub-packages to implement test discovery.
* | Issue #21503: Use test_both() consistently in test_importlib.Eric Snow2014-05-165-34/+82
| |
* | Issue #19721: Consolidate test_importlib utility code into a singleBrett Cannon2014-05-096-140/+39
|/ | | | module.
* merge 3.3 (#20796)Benjamin Peterson2014-02-271-0/+1
|\
| * fix importlib test failure when bytecode writing is disabled (closes #20796)Benjamin Peterson2014-02-271-0/+1
| | | | | | | | Patch by Berker Peksag.
* | Issue 19713: Add PEP 451-related deprecations.Eric Snow2014-01-073-31/+93
| |
* | Issue #19927: Add __eq__ to path-based loaders in importlib.Eric Snow2014-01-041-0/+13
| |
* | Issue #19712: Update test.test_importlib.source for PEP 451Brett Cannon2013-12-064-24/+140
| |
* | Issue #16803: test.test_importlib.source now tests frozen and source codeBrett Cannon2013-11-085-74/+91
| |
* | Issue #16803: Stop having test.test_importlib.abc ABCs inherit fromBrett Cannon2013-10-252-2/+7
| | | | | | | | | | unittest.TestCase in prep of running tests under frozen and source importlib.
* | Issue #18873: The tokenize module, IDLE, 2to3, and the findnocoding.py scriptSerhiy Storchaka2013-09-161-3/+3
|\ \ | |/ | | | | now detect Python source code encoding only in comment lines.
| * Issue #18873: The tokenize module, IDLE, 2to3, and the findnocoding.py scriptSerhiy Storchaka2013-09-161-3/+3
| | | | | | | | now detect Python source code encoding only in comment lines.
* | Issue #16826: Revert fix while Windows issues are being worked out.Meador Inge2013-09-041-57/+10
|\ \ | |/
| * Issue #16826: Revert fix while Windows issues are being worked out.Meador Inge2013-09-041-57/+10
| |
* | Issue #16826: Don't check for PYTHONCASEOK when using -E.Meador Inge2013-09-031-10/+57
|\ \ | |/ | | | | | | This commit fixes a regression that sneaked into Python 3.3 where importlib was not respecting -E when checking for the PYTHONCASEOK environment variable.
| * Issue #16826: Don't check for PYTHONCASEOK when using -E.Meador Inge2013-09-031-10/+57
| | | | | | | | | | This commit fixes a regression that sneaked into Python 3.3 where importlib was not respecting -E when checking for the PYTHONCASEOK environment variable.
* | Issue #17177: The imp module is pending deprecation.Brett Cannon2013-06-161-1/+0
| | | | | | | | | | | | To make sure there is no issue with code that is both Python 2 and 3 compatible, there are no plans to remove the module any sooner than Python 4 (unless the community moves to Python 3 solidly before then).
* | Issue #17177: stop using imp in test_importlibBrett Cannon2013-06-155-14/+14
| |
* | Issues #18088, 18089: IntroduceBrett Cannon2013-05-311-25/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | importlib.abc.Loader.init_module_attrs() and implement importlib.abc.InspectLoader.load_module(). The importlib.abc.Loader.init_module_attrs() method sets the various attributes on the module being loaded. It is done unconditionally to support reloading. Typically people used importlib.util.module_for_loader, but since that's a decorator there was no way to override it's actions, so init_module_attrs() came into existence to allow for overriding. This is also why module_for_loader is now pending deprecation (having its other use replaced by importlib.util.module_to_load). All of this allowed for importlib.abc.InspectLoader.load_module() to be implemented. At this point you can now implement a loader with nothing more than get_code() (which only requires get_source(); package support requires is_package()). Thanks to init_module_attrs() the implementation of load_module() is basically a context manager containing 2 methods calls, a call to exec(), and a return statement.
* | Issue #17093,17566,17567: Methods from classes in importlib.abc now raise/returnBrett Cannon2013-04-091-410/+0
| | | | | | | | | | | | | | | | | | | | the default exception/value when called instead of raising/returning NotimplementedError/NotImplemented (except where appropriate). This should allow for the ABCs to act as the bottom/end of the MRO with expected default results. As part of this work, also make importlib.abc.Loader.module_repr() optional instead of an abstractmethod.
* | #11420: merge with 3.3.Ezio Melotti2013-03-161-1/+2
|\ \ | |/
| * #11420: merge with 3.2.Ezio Melotti2013-03-161-1/+2
| |
* | Merge from 3.3 for fix for issue #16730Brett Cannon2013-01-111-0/+35
|\ \ | |/
| * Issue #16730: Don't raise an exception inBrett Cannon2013-01-111-0/+35
| | | | | | | | | | | | | | | | importlib.machinery.FileFinder when the directory has become unreadable or a file. This brings semantics in line with Python 3.2 import. Reported and diagnosed by David Pritchard.
* | Replace IOError with OSError (#16715)Andrew Svetlov2012-12-252-8/+8
| |
* | Issue #15627: This is simply an update to the name of a new method recently ↵Eric Snow2012-12-051-2/+2
| | | | | | | | | | | | added to importlib.abc.SourceLoader.
* | Issue #15627: Add the compile_source() method toBrett Cannon2012-11-181-6/+9
| | | | | | | | | | | | | | importlib.abc.SourceLoader. This provides an easy hook into the import system to allow for source transformations, AST optimizations, etc.
* | Issue #15641: Clean up deprecated classes from importlibAndrew Svetlov2012-11-051-502/+3
|/ | | | Patch by Taras Lyapun.
* Close #14846: Handle a sys.path entry going awayNick Coghlan2012-08-201-3/+12
|
* Issue #15576: Allow extension modules to be a package's __init__Brett Cannon2012-08-103-9/+7
| | | | | module again. Also took the opportunity to stop accidentally exporting _imp.extension_suffixes() as public.
* Issue #15502: Bring the importlib ABCs into line with the current state of ↵Nick Coghlan2012-08-021-6/+15
| | | | the import protocols given PEP 420. Original patch by Eric Snow.
* abc fixes.Barry Warsaw2012-07-312-0/+13
|
* Issue #15168: Move importlb.test to test.test_importlib.Brett Cannon2012-07-208-0/+1852
This should make the Linux distros happy as it is now easier to leave importlib's tests out of their base Python distribution.