Commit Graph

79658 Commits

Author SHA1 Message Date
Victor Stinner 24e33acf8c Issue #17206: On Windows, increase the stack size from 2 MB to 4.2 MB to fix
a stack overflow in the marshal module (fix a crash in test_marshal).
Patch written by Jeremy Kloth.
2013-07-07 02:49:07 +02:00
Victor Stinner 0507bf56f0 Issue #3329: Implement the PEP 445
Add new enum:

* PyMemAllocatorDomain

Add new structures:

* PyMemAllocator
* PyObjectArenaAllocator

Add new functions:

* PyMem_RawMalloc(), PyMem_RawRealloc(), PyMem_RawFree()
* PyMem_GetAllocator(), PyMem_SetAllocator()
* PyObject_GetArenaAllocator(), PyObject_SetArenaAllocator()
* PyMem_SetupDebugHooks()

Changes:

* PyMem_Malloc()/PyObject_Realloc() now always call malloc()/realloc(), instead
  of calling PyObject_Malloc()/PyObject_Realloc() in debug mode.
* PyObject_Malloc()/PyObject_Realloc() now falls back to
  PyMem_Malloc()/PyMem_Realloc() for allocations larger than 512 bytes.
* Redesign debug checks on memory block allocators as hooks, instead of using C
  macros
2013-07-07 02:05:46 +02:00
Raymond Hettinger df715ba54d Apply the PyObject_VAR_HEAD and Py_SIZE macros
to be consistent with practices in other modules.
2013-07-06 13:01:13 -10:00
Brett Cannon b1f7632c1c merge 2013-07-06 18:05:02 -04:00
Brett Cannon 7e5d55705c merge for issue #18351. 2013-07-06 18:04:41 -04:00
Raymond Hettinger 5bfa8671bc Refactor deque_traverse().
Hoist conditional expression out of the loop.
Use rightblock as the guard instead of checking for NULL.
2013-07-06 11:58:09 -10:00
Brett Cannon a53cca3fea Issue #18351: Fix various issues with
importlib._bootstrap._get_sourcefile().

Thanks to its only use by the C API, it was never properly tested
until now.

Thanks to Neal Norwitz for discovering the bug and Madison May for the patch.
2013-07-06 17:56:43 -04:00
Raymond Hettinger 98054b4c1b Remove unnecessary branches from count() and reverse(). 2013-07-06 09:07:06 -10:00
Brett Cannon 0075110ab2 Issue #18364: Stop using the ImportError._not_found hack.
The private attribute was leaking out of importlib and led to at least
one person noticing it. Switch to another hack which won't leak
outside of importlib and is nearly as robust.
2013-07-06 14:48:18 -04:00
Ezio Melotti e0a39de647 #18380: merge with 3.3. 2013-07-06 17:17:45 +02:00
Ezio Melotti 2a99d5df63 #18380: pass regex flags to the right argument. Patch by Valentina Mukhamedzhanova. 2013-07-06 17:16:04 +02:00
Florent Xicluna c2464bf5c6 test_ftplib: silence a BytesWarning when checking TypeError 2013-07-06 15:08:29 +02:00
Florent Xicluna 5f3fef37f6 test_ftplib: silence a BytesWarning when checking TypeError 2013-07-06 15:08:21 +02:00
Ronald Oussoren 361b28dbd4 (3.3->default) Issue #12990: The "Python Launcher" on OSX could not launch python scripts that have paths that include wide characters. 2013-07-06 13:25:44 +02:00
Ronald Oussoren fd1c69e2a4 Issue #12990: The "Python Launcher" on OSX could not launch python scripts that have paths that include wide characters. 2013-07-06 13:20:57 +02:00
Florent Xicluna 8624ed502f Issue #18375: merge with 3.3 2013-07-06 12:27:50 +02:00
Florent Xicluna d9e7c86d7e Issue #18375: Assume --randomize when --randseed is used for running the testsuite. 2013-07-06 12:25:52 +02:00
Ronald Oussoren c17d0c2218 (3.3->default) Issue #17860: explicitly mention that std* streams are opened in binary mode by default.
The documentation does mention that the streams are opened in text mode
when univeral_newlines is true, but not that that they are opened in
binary mode when that argument is false and that seems to confuse at
least some users.
2013-07-06 10:25:04 +02:00
Ronald Oussoren a68650553d Issue #17860: explicitly mention that std* streams are opened in binary mode by default.
The documentation does mention that the streams are opened in text mode
when univeral_newlines is true, but not that that they are opened in
binary mode when that argument is false and that seems to confuse at
least some users.
2013-07-06 10:23:59 +02:00
Raymond Hettinger de68e0cf0e Speed-up deque indexing by changing the deque block length to a power of two.
The division and modulo calculation in deque_item() can be compiled
to fast bitwise operations when the BLOCKLEN is a power of two.

Timing before:

 ~/cpython $ py -m timeit -r7 -s 'from collections import deque' -s 'd=deque(range(10))' 'd[5]'
10000000 loops, best of 7: 0.0627 usec per loop

Timing after:

~/cpython $ py -m timeit -r7 -s 'from collections import deque' -s 'd=deque(range(10))' 'd[5]'
10000000 loops, best of 7: 0.0581 usec per loop
2013-07-05 18:05:29 -10:00
Christian Heimes 6597aa16b6 Issue #18347: ElementTree's html serializer now preserves the case of closing tags. 2013-07-05 01:40:52 +02:00
Christian Heimes 54ad7e39df Issue #18347: ElementTree's html serializer now preserves the case of closing tags. 2013-07-05 01:39:49 +02:00
Brett Cannon 260fbe80c5 Issue #15767: Excise the remaining instances of ModuleNotFoundError 2013-07-04 18:16:15 -04:00
Brett Cannon 3dfd23245b Remove dead code in test_exceptions. 2013-07-04 18:04:20 -04:00
Brett Cannon fc4b5b9a42 Move test_import over to unittest.main(). 2013-07-04 18:03:57 -04:00
Brett Cannon 679ecb565b Issue #15767: back out 8a0ed9f63c6e, finishing the removal of
ModuleNotFoundError.
2013-07-04 17:51:50 -04:00
Brett Cannon 82da8886cc Issue #15767: Revert 3a50025f1900 for ModuleNotFoundError 2013-07-04 17:48:16 -04:00
Brett Cannon 45091c0a0c Issue #15767: Back out 8d28d44f3a9a related to ModuleNotFoundError. 2013-07-04 17:44:08 -04:00
Brett Cannon cd171c8e92 Issue #18200: Back out usage of ModuleNotFoundError (8d28d44f3a9a) 2013-07-04 17:43:24 -04:00
Antoine Pitrou fff59155d4 Consolidate tests section. 2013-07-04 21:06:12 +02:00
Antoine Pitrou 0cb1e9ab97 Issue #11185: Fix test_wait4 under AIX. Patch by Sébastien Sablé. 2013-07-04 21:05:30 +02:00
Antoine Pitrou be9c841494 Issue #11185: Fix test_wait4 under AIX. Patch by Sébastien Sablé. 2013-07-04 21:03:10 +02:00
Victor Stinner 7e71c5672c (Merge 3.3) test_time.test_monotonic(): use a longer sleep to try to make the test more reliable 2013-07-03 23:07:59 +02:00
Victor Stinner a9c99a6119 test_time.test_monotonic(): use a longer sleep to try to make the test more reliable 2013-07-03 23:07:37 +02:00
Victor Stinner 647d1e1acd (Merge 3.3) test_faulthandler: skip test_read_null() on AIX
AIX maps the first page of memory at address zero as valid, read-only.  Reading
NULL is not a fault on AIX. This is utilized by IBM compiler optimizations.
One speculatively can indirect through a pointer which may be null without
first testing if null and defer the test before using the value.
2013-07-03 22:35:39 +02:00
Victor Stinner 330426cfe2 test_faulthandler: skip test_read_null() on AIX
AIX maps the first page of memory at address zero as valid, read-only.  Reading
NULL is not a fault on AIX. This is utilized by IBM compiler optimizations.
One speculatively can indirect through a pointer which may be null without
first testing if null and defer the test before using the value.
2013-07-03 22:29:42 +02:00
Eric V. Smith ee31bc09cf #18312: merge from 3.3. 2013-07-02 09:07:53 -04:00
Eric V. Smith f4c47b5a35 Closes #18312: 'make distclean' no longer deletes files in dot-directories. 2013-07-02 09:06:54 -04:00
Richard Oudkerk 1b6348e084 Issue #17261: Ensure multiprocessing's proxies use proper address. 2013-07-02 13:38:58 +01:00
Richard Oudkerk e3e8bcf3e7 Issue #17261: Ensure multiprocessing's proxies use proper address. 2013-07-02 13:37:43 +01:00
Richard Oudkerk 771b961d4e Issue #14206: Clarify docs for Queue.join_cancel_thread(). 2013-07-02 13:01:31 +01:00
Richard Oudkerk d7d3f376dd Issue #14206: Clarify docs for Queue.join_cancel_thread(). 2013-07-02 12:59:55 +01:00
Richard Oudkerk b0be62453f Issue #17273: Clarify that pool methods can only be used by parent process. 2013-07-02 12:41:00 +01:00
Richard Oudkerk b3c4b98c23 Issue #17273: Clarify that pool methods can only be used by parent process. 2013-07-02 12:32:00 +01:00
Victor Stinner 0857ab4c77 (Merge 3.3) Issue #18343: faulthandler.register() now keeps the previous signal
handler when the function is called twice, so faulthandler.unregister()
restores correctly the original signal handler.
2013-07-02 00:17:14 +02:00
Victor Stinner 8d3795474e Issue #18343: faulthandler.register() now keeps the previous signal handler
when the function is called twice, so faulthandler.unregister() restores
correctly the original signal handler.
2013-07-02 00:14:56 +02:00
Christian Heimes 1d5b933504 Issue #18328: Reorder ops in PyThreadState_Delete*() functions. Now the
tstate is first removed from TLS and then deallocated.
CID 1019639 (#1 of 1): Use after free (USE_AFTER_FREE)
 use_after_free: Using freed pointer tstate.
2013-07-01 23:43:09 +02:00
Christian Heimes b9dbc7d6e1 Issue #18328: Reorder ops in PyThreadState_Delete*() functions. Now the
tstate is first removed from TLS and then deallocated.
CID 1019639 (#1 of 1): Use after free (USE_AFTER_FREE)
 use_after_free: Using freed pointer tstate.
2013-07-01 23:42:28 +02:00
Christian Heimes 3126a3d156 Issue #18339: use with self.assertRaises() to make test case more readable 2013-07-01 23:00:22 +02:00
Christian Heimes 2178248858 Issue #18339: use with self.assertRaises() to make test case more readable 2013-07-01 23:00:13 +02:00