summaryrefslogtreecommitdiffstats
path: root/Python
Commit message (Collapse)AuthorAgeFilesLines
* import.c does neither need mode_t nor _mkdir() anymoreChristian Heimes2013-06-231-8/+0
|
* (Merge 3.3) Issue #18137: Detect integer overflow on precision inVictor Stinner2013-06-231-2/+14
|\ | | | | | | float.__format__() and complex.__format__().
| * Issue #18137: Detect integer overflow on precision in float.__format__() andVictor Stinner2013-06-231-2/+14
| | | | | | | | complex.__format__().
* | marshal: optimize parsing of empty Unicode stringsVictor Stinner2013-06-211-12/+17
| | | | | | | | | | Don't create a temporary buffer of zeroy byte nor call r_string() if the length is zero, create directly the empty string.
* | #13226: update references from ctypes/DLFCN modules to os moduleAndrew Kuchling2013-06-211-2/+2
| |
* | Issue #18256: Compilation fix for recent AIX releases. Patch by David Edelsohn.Antoine Pitrou2013-06-181-0/+3
|\ \ | |/
| * Issue #18256: Compilation fix for recent AIX releases. Patch by David Edelsohn.Antoine Pitrou2013-06-181-0/+3
| |
| * Fix a misnaming of a method and an argumentBrett Cannon2013-06-161-1071/+1071
| |
* | Issue #18076: Introduce imoportlib.util.decode_source().Brett Cannon2013-06-161-3549/+3566
| | | | | | | | | | | | | | The helper function makes it easier to implement imoprtlib.abc.InspectLoader.get_source() by making that function require just the raw bytes for source code and handling all other details.
* | importlib.abc.SourceLoader.get_source() was re-raising SyntaxError andBrett Cannon2013-06-161-1719/+1703
| | | | | | | | | | | | | | | | | | UnicodeDecodeError as ImportError. That was over-reaching the point of raising ImportError in get_source() (which is to signal the source code was not found when it should have). Conflating the two exceptions with ImportError could lead to masking errors with the source which should be known outside of whether there was an error simply getting the source to begin with.
* | Issue #18115: Abstract out managing the cleanup of modules to use inBrett Cannon2013-06-161-2437/+2468
| | | | | | | | loaders where C code provides the loaded module.
* | Issues #18058, 18057: Make importlib._bootstrap.NamespaceLoaderBrett Cannon2013-06-161-1072/+1113
| | | | | | | | | | conform the the InspectLoader ABC. Perk of this is that runpy/-m can now work with namespace packages.
* | Issue #17907: touch up the code for imp.new_module().Brett Cannon2013-06-151-3532/+3519
| |
* | Issue #18192: Introduce importlib.util.MAGIC_NUMBER and document theBrett Cannon2013-06-141-2/+2
| | | | | | | | deprecation of imp.get_magic().
* | Issue #15767: Touch up ModuleNotFoundError usage by import.Brett Cannon2013-06-133-6/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | Forgot to raise ModuleNotFoundError when None is found in sys.modules. This led to introducing the C function PyErr_SetImportErrorSubclass() to make setting ModuleNotFoundError easier. Also updated the reference docs to mention ModuleNotFoundError appropriately. Updated the docs for ModuleNotFoundError to mention the None in sys.modules case. Lastly, it was noticed that PyErr_SetImportError() was not setting an exception when returning None in one case. That issue is now fixed.
* | Issue #15767: Introduce ModuleNotFoundError, a subclass ofBrett Cannon2013-06-122-371/+368
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ImportError. The exception is raised by import when a module could not be found. Technically this is defined as no viable loader could be found for the specified module. This includes ``from ... import`` statements so that the module usage is consistent for all situations where import couldn't find what was requested. This should allow for the common idiom of:: try: import something except ImportError: pass to be updated to using ModuleNotFoundError and not accidentally mask ImportError messages that should propagate (e.g. issues with a loader). This work was driven by the fact that the ``from ... import`` statement needed to be able to tell the difference between an ImportError that simply couldn't find a module (and thus silence the exception so that ceval can raise it) and an ImportError that represented an actual problem.
* | Merge.Richard Oudkerk2013-06-101-2/+3
|\ \ | |/
| * Issue #18180: Fix ref leak in _PyImport_GetDynLoadWindows().Richard Oudkerk2013-06-101-2/+3
| |
| * move definition to top of blockBenjamin Peterson2013-05-171-1/+2
| |
| * complain about "global __class__" in a class body (closes #17983)Benjamin Peterson2013-05-151-0/+6
| |
| * when arguments are cells clear the locals slot (backport of #17927)Benjamin Peterson2013-05-151-2/+6
| |
* | tweak exception message (again)Brett Cannon2013-06-051-2304/+2305
| |
* | Issue #9566: Fix compilater warnings on Windows 64-bitVictor Stinner2013-06-041-1/+1
| |
* | Issue #9566: Fix compiler warning on Windows 64-bitVictor Stinner2013-06-041-1/+2
| |
* | Tweak at the suggestion of Ezio Melotti for exception messages whenBrett Cannon2013-06-041-2300/+2302
| | | | | | | | EOF is hit while trying to read the header of a bytecode file.
* | Issue #18065: For frozen packages set __path__ to [].Brett Cannon2013-06-011-4/+2
| | | | | | | | | | | | | | Previously __path__ was set to [__name__], but that could lead to bad results if someone managed to circumvent the frozen importer and somehow ended up with a finder that thought __name__ was a legit directory/location.
* | Issues #18088, 18089: IntroduceBrett Cannon2013-05-311-3519/+3511
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Rename importlib.util.ModuleManager to module_to_load so that the nameBrett Cannon2013-05-301-3509/+3522
| | | | | | | | explains better what the context manager is providing.
* | Issue #18070: importlib.util.module_for_loader() now sets __loader__Brett Cannon2013-05-281-3432/+3413
| | | | | | | | | | and __package__ unconditionally in order to do the right thing for reloading.
* | Update importlib.hBrett Cannon2013-05-281-2676/+2675
| |
* | Introduce importlib.util.ModuleManager which is a context manager toBrett Cannon2013-05-281-3328/+3400
| | | | | | | | | | | | | | | | handle providing (and cleaning up if needed) the module to be loaded. A future commit will use the context manager in Lib/importlib/_bootstrap.py and thus why the code is placed there instead of in Lib/importlib/util.py.
* | Issue #17917: Use PyModule_AddIntMacro() instead of PyModule_AddIntConstant()Charles-Francois Natali2013-05-201-1/+1
| | | | | | | | when applicable.
* | Issue #17937: Try harder to collect cyclic garbage at shutdown.Antoine Pitrou2013-05-181-0/+1
| |
* | Use PY_FORMAT_SIZE_T because Visual Studio does not understand %zd format.Richard Oudkerk2013-05-181-1/+1
| |
* | Fix compilater warnings on Windows 64-bitVictor Stinner2013-05-162-4/+4
| |
* | Fix a compilater warning on Windows 64-bitVictor Stinner2013-05-161-1/+1
| |
* | Fix a compilater warning on Windows 64-bitVictor Stinner2013-05-161-1/+1
| | | | | | | | idx variable is used for a tuple indexn so use Py_ssize_t (not int).
* | fix compilation on WindowsVictor Stinner2013-05-161-1/+2
| |
* | rather than passing locals to the class body, just execute the class body in ↵Benjamin Peterson2013-05-166-3157/+3132
| | | | | | | | the proper environment
* | hide the __class__ closure from the class body (#12370)Benjamin Peterson2013-05-153-149/+187
| |
* | when an argument is a cell, set the local copy to NULL (see #17927)Benjamin Peterson2013-05-121-8/+4
| |
* | #17927: Keep frame from referencing cell-ified arguments.Guido van Rossum2013-05-101-4/+12
| |
* | Issue #17912: Use a doubly linked-list for thread states.Charles-Francois Natali2013-05-081-41/+17
| |
* | Issue #1545463: At shutdown, defer finalization of codec modules so that ↵Antoine Pitrou2013-05-082-22/+80
| | | | | | | | | | | | stderr remains usable. (should fix Windows buildbot failures on test_gc)
* | Fix a compiler warning: use unsigned int type instead of enum PyUnicode_Kind toVictor Stinner2013-05-071-1/+1
| | | | | | | | compare two Unicode kinds
* | Fix a compiler warning: in and out are unused in _Py_char2wchar() ifVictor Stinner2013-05-071-1/+1
| | | | | | | | HAVE_MBRTOWC is not defined
* | Issue #1545463: Global variables caught in reference cycles are now ↵Antoine Pitrou2013-05-062-4/+9
| | | | | | | | garbage-collected at shutdown.
* | Issue #17094: Clear stale thread states after fork().Antoine Pitrou2013-05-052-8/+57
| | | | | | | | | | | | | | Note that this is a potentially disruptive change since it may release some system resources which would otherwise remain perpetually alive (e.g. database connections kept in thread-local storage).
* | Fix crash caused by 8c1385205a35Antoine Pitrou2013-05-051-6/+8
|\ \ | |/ | | | | (thanks Arfrever for reporting).
| * Fix crash caused by 8c1385205a35Antoine Pitrou2013-05-051-6/+8
| | | | | | | | (thanks Arfrever for reporting).