Brett Cannon
8ed677db12
Add some comments.
14 years ago
Benjamin Peterson
0beb4d28d0
don't depend on __debug__ because it's baked in at freeze time (issue #16046 )
14 years ago
Benjamin Peterson
feaa54f537
don't depend on __debug__ because it's baked in at freeze time (issue #16046 )
14 years ago
Antoine Pitrou
ca8aa4acf6
Issue #15144 : Fix possible integer overflow when handling pointers as integer values, by using Py_uintptr_t instead of size_t.
Patch by Serhiy Storchaka.
14 years ago
Christian Heimes
55ad6515c9
Cleanup 'k' when the creation of PySTEntryObject fails. ad3824a90261 used to decref 'k' in too many error cases.
14 years ago
Christian Heimes
1526582df6
Partly revert ad3824a90261 and add comment about reference ownership
14 years ago
Christian Heimes
5557a9c73f
Fix null pointer dereferencing in structmember.c PyMember_SetOne() for T_CHAR. _PyUnicode_AsStringAndSize() can return NULL without touching the len argument. Also remove unnecessary PyUnicode_Check(), _PyUnicode_AsStringAndSize() performance the test again. CID 486815
14 years ago
Christian Heimes
6d29352cfd
Issue #15895 : my analysis was slightly off. The FILE pointer is only leaked when set_main_loader() fails for a pyc file with closeit=0. In the success case run_pyc_file() does its own cleanup of the fp. I've changed the code to use another FILE ptr for pyc files and moved the fclose() to PyRun_SimpleFileExFlags() to make it more obvious what's happening.
14 years ago
Christian Heimes
6a77af690f
Issue #15895 : Fix FILE pointer leak in PyRun_SimpleFileExFlags() when filename points to a pyc/pyo file and closeit is false.
14 years ago
Christian Heimes
3d463393bb
Fixed memory leak in error branch of parsestrplus. CID 715374 Variable s going out of scope leaks the storage it points to.
14 years ago
Christian Heimes
48d8d21438
Added missing va_end in error branch of PyArg_UnpackTuple(). CID 486641
14 years ago
Christian Heimes
04ac4c1cb8
Issue #15895 : my analysis was slightly off. The FILE pointer is only leaked when set_main_loader() fails for a pyc file with closeit=0. In the success case run_pyc_file() does its own cleanup of the fp. I've changed the code to use another FILE ptr for pyc files and moved the fclose() to PyRun_SimpleFileExFlags() to make it more obvious what's happening.
14 years ago
Christian Heimes
eeb5635843
Issue #15895 : Fix FILE pointer leak in PyRun_SimpleFileExFlags() when filename points to a pyc/pyo file and closeit is false.
14 years ago
Christian Heimes
837e53a7c2
Closed reference leak of variable 'k' in function ste_new which wasn't decrefed in error cases
14 years ago
Antoine Pitrou
7ff1822ec7
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
Stefan Krah
d9c1bf7f1f
After the jump in line 1051 unicode_tmp is NULL. Found by Coverity.
14 years ago
Antoine Pitrou
56cd62c04a
Issue #13992 : The trashcan mechanism is now thread-safe. This eliminates
sporadic crashes in multi-thread programs when several long deallocator
chains ran concurrently and involved subclasses of built-in container
types.
Because of this change, a couple extension modules compiled for 3.2.4
(those which use the trashcan mechanism, despite it being undocumented)
will not be loadable by 3.2.3 and earlier. However, extension modules
compiled for 3.2.3 and earlier will be loadable by 3.2.4.
14 years ago
Benjamin Peterson
c7dedb0945
put * in the normal place
14 years ago
Benjamin Peterson
bd0df50fb6
get rid of ast_error_finish by passing the compiling struct to ast_error
14 years ago
Benjamin Peterson
c5d7518a2e
move variable decl to the top of the function
14 years ago
Benjamin Peterson
2e2c903700
prevert ast errors from being normalized before ast_error_finish is called ( closes #15846 )
14 years ago
Antoine Pitrou
2b0218a259
Issue #13992 : The trashcan mechanism is now thread-safe. This eliminates
sporadic crashes in multi-thread programs when several long deallocator
chains ran concurrently and involved subclasses of built-in container
types.
Because of this change, a couple extension modules compiled for 3.2.4
(those which use the trashcan mechanism, despite it being undocumented)
will not be loadable by 3.2.3 and earlier. However, extension modules
compiled for 3.2.3 and earlier will be loadable by 3.2.4.
14 years ago
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
Antoine Pitrou
4f0338cab7
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