Commit graph

8559 commits

Author SHA1 Message Date
Stefan Krah
7213fcc27e Issue #23370: Fix off-by-one error for non-contiguous buffers. 2015-02-01 16:19:23 +01:00
Stefan Krah
363af44a4a Issue #22445: PyBuffer_IsContiguous() now implements precise contiguity
tests, compatible with NumPy's NPY_RELAXED_STRIDES_CHECKING compilation
flag.  Previously the function reported false negatives for corner cases.
2015-02-01 14:53:54 +01:00
Gregory P. Smith
bd4976bbd3 Always #define _PyLong_FromDev as we always need it to compile rather than
only defining it when HAVE_MKNOD && HAVE_MAKEDEV are true.

This "oops" issue reported by John E. Malmberg on core-mentorship.
(what kinds of systems don't HAVE_MKNOD && HAVE_MAKEDEV?)
2015-01-28 16:08:07 -08:00
Gregory P. Smith
702dada2c5 Always #define _PyLong_FromDev as we always need it to compile rather than
only defining it when HAVE_MKNOD && HAVE_MAKEDEV are true.

This "oops" issue reported by John E. Malmberg on core-mentorship.
(what kinds of systems don't HAVE_MKNOD && HAVE_MAKEDEV?)
2015-01-28 16:07:52 -08:00
Benjamin Peterson
c54de47759 ifdef our way to compatibility with old openssl (closes #23335) 2015-01-28 12:06:39 -05:00
Benjamin Peterson
07f0515667 disable ALPN on LibreSSL, which has a large version number, but not ALPN support (closes #23329) 2015-01-27 11:10:18 -05:00
Victor Stinner
3bf8684c5e Merge 3.4 (asyncio) 2015-01-26 22:43:52 +01:00
Victor Stinner
498b1f62db asyncio, _overlapped.ConnectPipe(): release the GIL 2015-01-26 22:43:39 +01:00
Victor Stinner
c27a8afcb0 Merge 3.4 (asyncio) 2015-01-26 22:31:03 +01:00
Victor Stinner
41063d2a59 asyncio, Tulip issue 204: Fix IocpProactor.recv()
If ReadFile() fails with ERROR_BROKEN_PIPE, the operation is not pending: don't
register the overlapped.

I don't know if WSARecv() can fail with ERROR_BROKEN_PIPE. Since
Overlapped.WSARecv() already handled ERROR_BROKEN_PIPE, let me guess that it
has the same behaviour than ReadFile().
2015-01-26 22:30:49 +01:00
Serhiy Storchaka
47efb4a5dc Issue #19361: JSON decoder now raises JSONDecodeError instead of ValueError. 2015-01-26 13:16:30 +02:00
Steve Dower
7d0e0c9f7b Closes #23253: Delay-load ShellExecute 2015-01-24 08:18:24 -08:00
Benjamin Peterson
8861502e07 prefer server alpn ordering over the client's 2015-01-23 17:30:26 -05:00
Benjamin Peterson
cca2732a82 add support for ALPN (closes #20188) 2015-01-23 16:35:37 -05:00
Victor Stinner
5da0549154 Merge 3.4 (asyncio) 2015-01-22 23:50:34 +01:00
Victor Stinner
2b77c5467f asyncio, Tulip issue 204: Fix IocpProactor.accept_pipe()
Overlapped.ConnectNamedPipe() now returns a boolean: True if the pipe is
connected (if ConnectNamedPipe() failed with ERROR_PIPE_CONNECTED), False if
the connection is in progress.

This change removes multiple hacks in IocpProactor.
2015-01-22 23:50:03 +01:00
Victor Stinner
58c85144db Merge 3.4 (asyncio) 2015-01-22 22:55:31 +01:00
Victor Stinner
7ffa2c5fdd Issue #23293, asyncio: Rewrite IocpProactor.connect_pipe()
Add _overlapped.ConnectPipe() which tries to connect to the pipe for
asynchronous I/O (overlapped): call CreateFile() in a loop until it doesn't
fail with ERROR_PIPE_BUSY. Use an increasing delay between 1 ms and 100 ms.

Remove Overlapped.WaitNamedPipeAndConnect() which is no more used.
2015-01-22 22:55:08 +01:00
Victor Stinner
91d11bbb2d Merge 3.4 (asyncio) 2015-01-21 23:40:19 +01:00
Victor Stinner
d0a28dee78 Issue #23095, asyncio: Rewrite _WaitHandleFuture.cancel()
This change fixes a race conditon related to _WaitHandleFuture.cancel() leading
to Python crash or "GetQueuedCompletionStatus() returned an unexpected event"
logs. Before, the overlapped object was destroyed too early, it was possible
that the wait completed whereas the overlapped object was already destroyed.
Sometimes, a different overlapped was allocated at the same address, leading to
unexpected completition.

_WaitHandleFuture.cancel() now waits until the wait is cancelled to clear its
reference to the overlapped object. To wait until the cancellation is done,
UnregisterWaitEx() is used with an event instead of UnregisterWait().

To wait for this event, a new _WaitCancelFuture class was added. It's a
simplified version of _WaitCancelFuture. For example, its cancel() method calls
UnregisterWait(), not UnregisterWaitEx(). _WaitCancelFuture should not be
cancelled.

The overlapped object is kept alive in _WaitHandleFuture until the wait is
unregistered.

Other changes:

* Add _overlapped.UnregisterWaitEx()
* Remove fast-path in IocpProactor.wait_for_handle() to immediatly set the
  result if the wait already completed. I'm not sure that it's safe to
  call immediatly UnregisterWaitEx() before the completion was signaled.
* Add IocpProactor._unregistered() to forget an overlapped which may never be
  signaled, but may be signaled for the next loop iteration. It avoids to
  block forever IocpProactor.close() if a wait was cancelled, and it may also
  avoid some "... unexpected event ..." warnings.
2015-01-21 23:39:51 +01:00
Zachary Ware
b4826c3fd1 Merge with 3.4 (closes #23280) 2015-01-20 14:11:38 -06:00
Zachary Ware
b176d40398 Issue #23280: Fix docstrings for binascii.(un)hexlify 2015-01-20 13:59:46 -06:00
Antoine Pitrou
3b225d8bfb Issue #23248: Update ssl error codes from latest OpenSSL git master. 2015-01-18 17:40:17 +01:00
Antoine Pitrou
173ad83b07 Issue #23248: Update ssl error codes from latest OpenSSL git master. 2015-01-18 17:39:32 +01:00
Serhiy Storchaka
82e07b92b3 Issue #23181: More "codepoint" -> "code point". 2015-01-18 11:33:31 +02:00
Serhiy Storchaka
d3faf43f9b Issue #23181: More "codepoint" -> "code point". 2015-01-18 11:28:37 +02:00
Serhiy Storchaka
acdb7c158a Issue #23098: 64-bit dev_t is now supported in the os module. 2015-01-18 11:17:39 +02:00
Serhiy Storchaka
b2653b344e Issue #23098: 64-bit dev_t is now supported in the os module. 2015-01-18 11:12:11 +02:00
Antoine Pitrou
26795baaa8 Issue #15955: Add an option to limit output size when decompressing LZMA data.
Patch by Nikolaus Rath and Martin Panter.
2015-01-17 16:22:18 +01:00
Benjamin Peterson
610bc6a211 merge 3.4 (#23221) 2015-01-13 09:20:31 -05:00
Benjamin Peterson
82f34ada45 fix instances of consecutive articles (closes #23221)
Patch by Karan Goel.
2015-01-13 09:17:24 -05:00
Antoine Pitrou
dc3eaa80d4 Issue #23206: Make `json.dumps(..., ensure_ascii=False) as fast as the default case of ensure_ascii=True`. Patch by Naoki Inada. 2015-01-11 16:41:01 +01:00
Mark Dickinson
cc8617b93a Issue #21092: Merge from 3.4. 2015-01-11 13:22:44 +00:00
Mark Dickinson
dfe0b2326b Issue #21902: Replace incorrect 'hyperbolic arc sine' (etc.) with 'inverse hyperbolic sine' (etc.). Remove meaningless reference to radians. 2015-01-11 13:08:05 +00:00
Mark Dickinson
a5d0c7c2fd Issue #23185: add math.inf and math.nan constants. 2015-01-11 11:55:29 +00:00
Benjamin Peterson
baf7c1e546 use SSL_get_session 2015-01-07 11:32:00 -06:00
Benjamin Peterson
4cb17812d9 expose the client's cipher suites from the handshake (closes #23186) 2015-01-07 11:14:26 -06:00
Nick Coghlan
582acb75e9 Merge issue 19548 changes from 3.4 2015-01-07 00:37:01 +10:00
Nick Coghlan
b9fdb7a452 Issue 19548: update codecs module documentation
- clarified the distinction between text encodings and other codecs
- clarified relationship with builtin open and the io module
- consolidated documentation of error handlers into one section
- clarified type constraints of some behaviours
- added tests for some of the new statements in the docs
2015-01-07 00:22:00 +10:00
Victor Stinner
fcfed19913 Issue #21356: Make ssl.RAND_egd() optional to support LibreSSL. The
availability of the function is checked during the compilation. Patch written
by Bernard Spil.
2015-01-06 13:54:58 +01:00
Antoine Pitrou
bc26646505 Issue #23143: Remove compatibility with OpenSSLs older than 0.9.8.
(now the hashlib module)
2015-01-03 23:21:21 +01:00
Antoine Pitrou
5e8430d02c Issue #23143: Remove compatibility with OpenSSLs older than 0.9.8.
(the last 0.9.7 release was in 2007)
2015-01-03 23:17:23 +01:00
Benjamin Peterson
98beb7599e merge 3.4 (#23093) 2014-12-21 21:00:51 -06:00
Benjamin Peterson
10e76b67c9 allow more operations to work on detached streams (closes #23093)
Patch by Martin Panter.
2014-12-21 20:51:50 -06:00
Steve Dower
2a8ef68028 Issue #22733: MSVC ffi_prep_args doesn't handle 64-bit arguments properly 2014-12-17 06:31:44 -08:00
Serhiy Storchaka
707b5ccde5 Issue #22783: Pickling now uses the NEWOBJ opcode instead of the NEWOBJ_EX
opcode if possible.
2014-12-16 19:43:46 +02:00
Serhiy Storchaka
01bdd9a980 Issue #15513: Added a __sizeof__ implementation for pickle classes. 2014-12-16 19:40:58 +02:00
Serhiy Storchaka
5bbd231f27 Issue #15513: Added a __sizeof__ implementation for pickle classes. 2014-12-16 19:39:08 +02:00
Benjamin Peterson
e32467cf6a allow ssl module to compile if openssl doesn't support SSL 3 (closes #22935)
Patch by Kurt Roeckx.
2014-12-05 21:59:35 -05:00
Serhiy Storchaka
b757c83ec6 Issue #22581: Use more "bytes-like object" throughout the docs and comments. 2014-12-05 22:25:22 +02:00