Antoine Pitrou
380c55cc58
Issue #15340 : Fix importing the random module when /dev/urandom cannot be opened.
This was a regression caused by the hash randomization patch.
14 years ago
Antoine Pitrou
0398985920
Issue #15781 : Fix two small race conditions in import's module locking.
14 years ago
Brett Cannon
12c6bda4f0
Issue #15316 : Let exceptions raised during imports triggered by the
fromlist of __import__ propagate.
The problem previously was that if something listed in fromlist didn't
exist then that's okay. The fix for that was too broad in terms of
catching ImportError.
The trick with the solution to this issue is that the proper
refactoring of import thanks to importlib doesn't allow for a way to
distinguish (portably) between an ImportError because finders couldn't
find a loader, or a loader raised the exception. In Python 3.4 the
hope is to introduce a new exception (e.g. ModuleNotFound) to make it
clean to differentiate why ImportError was raised.
14 years ago
Brett Cannon
ba0a3edd26
Issue #2051 : Tweak last commit for this issue to pass in mode instead
of source path to set_data() and make the new argument private until
possible API changes can be discussed more thoroughly in Python 3.4.
14 years ago
Nick Coghlan
a508770e20
Close #2501 : Permission bits are once again correctly copied from the source file to the cached bytecode file. Test by Eric Snow.
14 years ago
Victor Stinner
ad54c6d82e
Issue #15766 : Fix a crash in imp.load_dynamic() on PyUnicode_FromString() failure
14 years ago
Antoine Pitrou
75506e8b7c
Issue #15726 : Fix incorrect bounds checking in PyState_FindModule.
Patch by Robin Schreiber.
14 years ago
Stefan Krah
07795df683
Issue #15741 : Fix potential NULL dereference. Found by Coverity.
14 years ago
Stefan Krah
28a2ad556a
Check return value of asdl_seq_new(). Found by Coverity.
14 years ago
Nick Coghlan
48fec05391
Close #14846 : Handle a sys.path entry going away
14 years ago
Brett Cannon
7385adc84c
Issue #15715 : Ignore failed imports triggered by the use of fromlist.
When the fromlist argument is specified for __import__() and the
attribute doesn't already exist, an import is attempted. If that fails
(e.g. module doesn't exist), the ImportError will now be silenced (for
backwards-compatibility). This *does not* affect
``from ... import ...`` statements.
Thanks to Eric Snow for the patch and Simon Feltman for reporting the
regression.
14 years ago
Antoine Pitrou
6f430e4963
Issue #15604 : Update uses of PyObject_IsTrue() to check for and handle errors correctly.
Patch by Serhiy Storchaka.
14 years ago
Brett Cannon
b428f47cf6
Don't overwrite a __path__ value from extension modules if already
set.
14 years ago
Philip Jenvey
688a551ca0
fix docstring wording
14 years ago
Brett Cannon
f410ce8c09
Issue #15502 : Refactor some code.
14 years ago
Senthil Kumaran
e9175bd0af
Fix issue #15607 : Update the print builtin function docstring with the new flush keyword.
Patch contributed by Daniel Ellis.
14 years ago
Philip Jenvey
731d48a65f
update docstring per the extension package fix, refactor
14 years ago
Brett Cannon
ac9f2f3de3
Issue #15576 : Allow extension modules to be a package's __init__
module again. Also took the opportunity to stop accidentally exporting
_imp.extension_suffixes() as public.
14 years ago
Brett Cannon
f4dc9204cc
Issue #15502 : Finish bringing importlib.abc in line with the current
state of the import system. Also make importlib.invalidate_caches()
work with sys.meta_path instead of sys.path_importer_cache to
completely separate the path-based import system from the overall
import system.
Patch by Eric Snow.
14 years ago
Victor Stinner
2d6266d5f1
Remove now unused IntOrLongToString type
14 years ago
Benjamin Peterson
b37df519c7
fix yield from return value on custom iterators ( closes #15568 )
14 years ago
Brett Cannon
cb4996afe4
Issue #15471 : Don't use mutable object as default values for the
parameters of importlib.__import__().
14 years ago
Brett Cannon
ecfefb7956
Fix a spelling mistake in a comment.
14 years ago
Antoine Pitrou
c4d974d3fa
Remove unused variable `trim_get_code`.
14 years ago
Victor Stinner
90ef747e04
Close #13119 : use "\r\n" newline for sys.stdout/err on Windows
sys.stdout and sys.stderr are now using "\r\n" newline on Windows, as Python 2.
14 years ago
Victor Stinner
7b3f0fa68e
Close #13119 : use "\r\n" newline for sys.stdout/err on Windows
sys.stdout and sys.stderr are now using "\r\n" newline on Windows, as Python 2.
14 years ago
Nick Coghlan
4941774f59
Issue #15502 : Bring the importlib.PathFinder docs and docstring more in line with the new import system documentation, and fix various parts of the new docs that weren't quite right given PEP 420 or were otherwise a bit misleading. Also note the key terminology problem still being discussed in the issue
14 years ago
Nick Coghlan
ff79486bb5
Close #15519 : Properly expose WindowsRegistryFinder in importlib and bring the name into line with normal import terminology. Original patch by Eric Snow
14 years ago
Nick Coghlan
42c0766a53
Close #15486 : Simplify the mechanism used to remove importlib frames from tracebacks when they just introduce irrelevant noise
14 years ago
Victor Stinner
d5698cbbca
Fix initialization of the faulthandler module
faulthandler requires the importlib if "-X faulthandler" option is present on
the command line, so initialize faulthandler after importlib.
Add also an unit test.
14 years ago
Brett Cannon
722d3aec2e
Issue #15508 : Fix the docstring for __import__ to not mention negative
'level' values and set its document default value to 0.
Thanks to Arfrever Frehtes Taifersar Arahesis for filing the bug.
14 years ago
Victor Stinner
54f939b9ae
Issue #15463 : the faulthandler module truncates strings to 500 characters,
instead of 100, to be able to display long file paths
14 years ago
Nick Coghlan
5ee9892406
Close #15425 : Eliminate more importlib related traceback noise
14 years ago
Martin v. Löwis
e3010a8d12
Issue #14578 : Support modules registered in the Windows registry again.
Patch by Amaury Forgeot d'Arc.
14 years ago
Martin v. Löwis
7e39572aa8
Issue #15466 : Stop using TYPE_INT64 in marshal,
to make importlib.h (and other byte code files) equal between 32-bit
and 64-bit systems.
14 years ago
Kristján Valur Jónsson
c5963d3842
Issue #15365 : Make traceback reporting ignore any errors when printing out
the source line. Such errors can't be reported anyway. This makes error
reporting work, even if the "io" module can't be loaded.
14 years ago
Meador Inge
996ae04943
remove unused variable
14 years ago
Benjamin Peterson
51ab2830bb
remove unused variable
14 years ago
Meador Inge
f69e24e3c6
Issue #15368 : fixing variable typo.
14 years ago
Meador Inge
2ca6315d15
Issue #15368 : make bytecode generation deterministic.
14 years ago
Nick Coghlan
b7a5894c64
Refcounting fixes
14 years ago
Nick Coghlan
ceda83c6a9
Make set_main_loader static (noticed by Antoine Pitrou)
14 years ago
Nick Coghlan
2824cb507d
Issue #15343 : A lot more than just unicode decoding can go wrong when retrieving a source file
14 years ago
Nick Coghlan
3f94cbf9eb
Actually initialize __main__.__loader__ with loader instances, not the corresponding type objects
14 years ago
Nick Coghlan
85e729ec3b
Take the first step in resolving the messy pkgutil vs importlib edge cases by basing pkgutil explicitly on importlib, deprecating its internal import emulation and setting __main__.__loader__ correctly so that runpy still works (Affects #15343 , #15314 , #15357 )
14 years ago
Brett Cannon
a6473f9cfd
Issues #15169 , #14599 : Make PyImport_ExecCodeModuleWithPathnames() use
Lib/imp.py for imp.source_from_cache() instead of its own C version.
Also change PyImport_ExecCodeModuleObject() to not infer the source
path from the bytecode path like
PyImport_ExecCodeModuleWithPathnames() does. This makes the function
less magical.
This also has the side-effect of removing all uses of MAXPATHLEN in
Python/import.c which can cause failures on really long filenames.
14 years ago
Antoine Pitrou
44b4b6a9a5
Fix compilation under Windows
14 years ago
Brett Cannon
461c813164
Issue #15111 : When a module was imported using a 'from import'
statement (e.g. ``from distutils import msvc9compiler``) that triggers
an ImportError of its own (e.g. the non-existence of winreg), let that
exception propagate instead of raising a generic ImportError for the
module being requested (e.g. msvc9compiler).
14 years ago
Benjamin Peterson
66f3659c9e
fix refleak
14 years ago
Benjamin Peterson
fa873704a4
initialize variable for compiler happiness
14 years ago