Commit Graph

7926 Commits

Author SHA1 Message Date
Christian Heimes a3da7c5f8a make char* const
readline() takes a const char* and the other readline_until_enter_or_signal() implementation
already has const char*.
2013-12-04 09:31:47 +01:00
Christian Heimes 47f02e5e17 ncurses' winch and mvwinch return an unsigned long 2013-12-04 08:50:32 +01:00
Christian Heimes abbc8ca708 ncurses' winch and mvwinch return an unsigned long 2013-12-04 08:50:22 +01:00
Victor Stinner 88c29877c7 Close #19741: tracemalloc_realloc() does not release the table lock anymore
between tracemalloc_remove_trace() and tracemalloc_add_trace() to reduce the
risk of race condition.

tracemalloc_add_trace() cannot fail anymore in tracemalloc_realloc() when
tracemalloc_realloc() resizes a memory block.
2013-12-04 01:47:46 +01:00
Victor Stinner 1511680b79 Close #19757: Cleanup tracemalloc, move
PyGILState_Ensure()/PyGILState_Release() calls to the raw wrappers to simplify
the code.

Rename also tracemalloc_log_alloc/log_free() to
tracemalloc_add_trace/remove_trace().
2013-12-04 01:29:35 +01:00
Victor Stinner 9a954838ab Close #19827: On UNIX, setblocking() and settimeout() methods of socket.socket
can now avoid a second syscall if the ioctl() function can be used, or if the
non-blocking flag of the socket is unchanged.
2013-12-04 00:41:24 +01:00
Stefan Krah 4b7f7acf30 Make a couple of parameters constant. 2013-12-03 14:33:46 +01:00
Stefan Krah b1e4c9d104 Make a couple of parameters constant. 2013-12-03 14:33:46 +01:00
Christian Heimes 1aa9a75fbf Issue #19509: Add SSLContext.check_hostname to match the peer's certificate
with server_hostname on handshake.
2013-12-02 02:41:19 +01:00
Gregory P. Smith 708a3182c9 Fixes issue #15798: subprocess.Popen() no longer fails if file
descriptor 0, 1 or 2 is closed.
The errpipe_write fd will always be >= 3.
2013-12-01 17:27:40 -08:00
Charles-François Natali 5abca14b00 Issue #18994: Add a missing check for a return value in fcntmodule. Patch by
Vajrasky Kok.
2013-12-01 14:30:47 +01:00
Victor Stinner be0708f066 Closes #19831: Stop tracemalloc later at Python shutdown to be able to use
tracemalloc in objects destructor

Replace atexit handler with an harcoded C function _PyTraceMalloc_Fini().
2013-12-01 10:03:26 +01:00
Gregory P. Smith 54532c9742 Undo supposed fix for Issue #15798 until I understand why this is
causing test_multiprocessing_forkserver and test_multiprocessing_spawn
failures on head (3.4).
2013-12-01 00:13:35 -08:00
Gregory P. Smith 361e30c17a Undo supposed fix for Issue #15798 until I understand why this is
causing test_multiprocessing_forkserver and test_multiprocessing_spawn
failures on head (3.4).
2013-12-01 00:12:24 -08:00
Gregory P. Smith 1c27e3c7fb Fixes Issue #15798 - subprocess.Popen() no longer fails if file
descriptor 0, 1 or 2 is closed.
2013-11-30 19:04:00 -08:00
Gregory P. Smith 1eda9e7c30 Fixes Issue #15798 - subprocess.Popen() no longer fails if file
descriptor 0, 1 or 2 is closed.
2013-11-30 19:02:57 -08:00
Alexandre Vassalotti 2ccf8e969c Issue #6477: Merge with 3.3. 2013-11-30 17:58:53 -08:00
Alexandre Vassalotti 65846c6c51 Issue #6477: Keep PyNotImplemented_Type and PyNone_Type private. 2013-11-30 17:55:48 -08:00
Alexandre Vassalotti 3c23e7a5dc Issue #6477: Merge with 3.3. 2013-11-30 16:21:20 -08:00
Alexandre Vassalotti 19b6fa6ebb Issue #6477: Added support for pickling the types of built-in singletons. 2013-11-30 16:06:39 -08:00
Alexandre Vassalotti a1eedf9ff0 Merge with 3.3. 2013-11-30 13:55:39 -08:00
Alexandre Vassalotti 896414fedf Fixed _pickle.Unpickler to handle empty persistent IDs correctly. 2013-11-30 13:52:35 -08:00
Serhiy Storchaka 6fe39b76a9 Issue #17897: Optimized unpickle prefetching. 2013-11-30 23:15:38 +02:00
Alexandre Vassalotti 9730e33535 Issue #3693: Fix array obscure error message when given a str. 2013-11-29 20:47:15 -08:00
Alexandre Vassalotti 567eba1852 Use PyDict_GetItemWithError instead of PyDict_GetItem in cpickle. 2013-11-28 17:09:16 -08:00
Alexandre Vassalotti 6bf41e54a4 Remove explicit empty tuple reuse in cpickle.
PyTuple_New(0) always returns the same empty tuple from its free list anyway,
so we are not saving much here. Plus, the code where this was used is on
uncommon run paths.
2013-11-28 15:17:29 -08:00
Alexandre Vassalotti b13e6bcbd8 Remove the tuple reuse optimization in _Pickle_FastCall.
I have noticed a race-condition occurring on one of the buildbots because of
this optimization. The function called may release the GIL which means
multiple threads may end up accessing the shared tuple. I could fix it up by
storing the tuple to the Pickler and Unipickler object again, but honestly it
really not worth the trouble.

I ran many benchmarks and the only time the optimization helps is when using a
fin-memory file, like io.BytesIO on which reads are super cheap, combined with
pickle protocol less than 4. Even in this contrived case, the speedup is a
about 5%. For everything else, this optimization does not provide any
noticable improvements.
2013-11-28 14:56:09 -08:00
Eli Bendersky 8148164353 Issue #19815: Fix segfault when parsing empty namespace declaration.
Based on patches by Christian Heimes and Vajrasky Kok
2013-11-28 06:35:40 -08:00
Eli Bendersky 4b79518f83 Fix indentation from previous commit 2013-11-28 06:33:21 -08:00
Eli Bendersky 5dd40e555b Issue #19815: Fix segfault when parsing empty namespace declaration.
Based on patches by Christian Heimes and Vajrasky Kok
2013-11-28 06:31:58 -08:00
Christian Heimes 470fba1f9f SNI was added in OpenSSL 0.9.8f [11 Oct 2007], too 2013-11-28 15:12:15 +01:00
Alexandre Vassalotti 23bdd83053 Encapsulate cpickle global state in a dedicated object.
This implements PEP 3121 module finalization as well. This change does not
cause any significant impact on performance.
2013-11-27 19:36:52 -08:00
Victor Stinner f28ce60441 Closes #19786: tracemalloc, remove the arbitrary limit of 100 frames
The limit is now 178,956,969 on 64 bit (it is greater on 32 bit because
structures are smaller).

Use int instead of Py_ssize_t to store the number of frames to have smaller
traceback_t objects.
2013-11-27 22:27:13 +01:00
Victor Stinner 3c0481d426 Close #19798: replace "maximum" term with "peak" in get_traced_memory()
documentation. Use also the term "current" for the current size.
2013-11-27 21:39:49 +01:00
Benjamin Peterson 1314ef73d0 add SO_PRIORITY (closes #19802)
Patch by Claudiu Popa.
2013-11-27 09:18:54 -06:00
Alexandre Vassalotti 20c28c1ea2 Combine the FastCall functions in cpickle.
I fixed the bug that was in my previous attempt of this cleanup. I ran
the full test suite to verify I didn't introduce any obvious bugs.
2013-11-27 02:26:54 -08:00
Serhiy Storchaka 687ff0ecdf Issue #11489: JSON decoder now accepts lone surrogates. 2013-11-26 21:27:11 +02:00
Serhiy Storchaka c93329b3dd Issue #11489: JSON decoder now accepts lone surrogates. 2013-11-26 21:25:28 +02:00
Victor Stinner 59463d8340 tracemalloc: fix get_traced_memory() docstring for result type 2013-11-26 10:46:06 +01:00
Victor Stinner 4dc74204c1 Issue #18874: Fix typo 2013-11-26 01:18:52 +01:00
Victor Stinner 2ead3d2448 Issue #18874: make it more explicit than set_reentrant() only accept 0 or 1 2013-11-26 01:08:53 +01:00
Victor Stinner 7a5be14dd8 Issue #18874: tracemalloc: Comment the trace_t structure 2013-11-26 01:06:02 +01:00
Victor Stinner de2f132a5e Issue #18874: tracemalloc: explain the purpose of get_traces.tracebacks in a comment 2013-11-26 00:26:23 +01:00
Victor Stinner 000de53624 Issue #19752: Fix "HAVE_DEV_PTMX" implementation of os.openpty()
Regression introduced by the implementation of the PEP 446 (non-inheritable
file descriptors by default).

master_fd must be set non-inheritable after the creation of the slave_fd,
otherwise grantpt(master_fd) fails with EPERM (errno 13).
2013-11-25 23:19:58 +01:00
Alexandre Vassalotti b4a04fb7e6 Reverting e39db21df580 eagerly due to buildbot failures. 2013-11-25 13:25:12 -08:00
Alexandre Vassalotti f94a041f8f Combine _Pickler_FastCall and _Unpickler_FastCall in cpickle. 2013-11-25 13:03:32 -08:00
Alexandre Vassalotti 1048fb5539 Issue #19739: Try to fix compiler warnings on 32-bit Windows. 2013-11-25 11:35:46 -08:00
Victor Stinner 4fbefdb217 Close #19762: Fix name of _get_traces() and _get_object_traceback() function
name in their docstring. Patch written by Vajrasky Kok.
2013-11-25 09:33:18 +01:00
Alexandre Vassalotti ded929b300 Merge save_int into save_long in cpickle to remove redundant code.
Also, replace unnessary uses of the #if preprocessor directive.
2013-11-24 22:41:13 -08:00
Alexandre Vassalotti 8a67f52463 Simplify save_bool in cpickle. 2013-11-24 21:40:18 -08:00