Commit Graph

100173 Commits

Author SHA1 Message Date
Jonathan Eunice faa57cbe70 bpo-30662: fixed OrderedDict.__init__ docstring re PEP 468 (#2179)
* fixed OrderedDict.__init__ docstring re PEP 468

* tightened comment and mirrored to C impl

* added space after period per marco-buttu

* preserved substituted for stable

* drop references to Python 3.6 and PEP 468
2017-09-05 16:23:49 -07:00
Victor Stinner af46eb8d5f _pickle: Fix whichmodule() (#3358)
_PyUnicode_FromId() can return NULL: replace Py_INCREF() with
Py_XINCREF().

Fix coverity report: CID 1417269.
2017-09-05 14:30:16 -07:00
Gregory P. Smith 564a2c68ad Link to blurb on PyPI in the NEWS.d READMEs. (#3323) 2017-09-05 10:38:05 -07:00
Raymond Hettinger 15ce0bee97 Conceptually, roots is a set. Also searching it as a set is a tiny bit faster (#3338) 2017-09-05 09:40:44 -07:00
Christian Heimes 75b961869a bpo-31343: Include sys/sysmacros.h (#3318)
Include sys/sysmacros.h for major(), minor(), and makedev(). GNU C libray
plans to remove the functions from sys/types.h.

Signed-off-by: Christian Heimes <christian@python.org>
2017-09-05 15:53:09 +02:00
Christian Heimes c941e6238a bpo-30102: Call OPENSSL_add_all_algorithms_noconf (#3112)
The ssl and hashlib modules now call OPENSSL_add_all_algorithms_noconf() on
OpenSSL < 1.1.0. The function detects CPU features and enables optimizations
on some CPU architectures such as POWER8. Patch is based on research from
Gustavo Serra Scalet.

Signed-off-by: Christian Heimes <christian@python.org>
2017-09-05 15:47:11 +02:00
Ned Deily 52451fbaaf Prevent a few make suspicious warnings. (#3341) 2017-09-05 01:34:47 -07:00
Ned Deily fcd97d4438 Include additional changes to support blurbified NEWS (#3340) 2017-09-05 00:46:18 -07:00
Ned Deily e295b82609 Simplify NEWS entry to prevent suspicious warnings. (#3339) 2017-09-05 00:45:36 -07:00
Benjamin Peterson a3070d530c bpo-31347: _PyObject_FastCall_Prepend: do not call memcpy if args might not be null (#3329)
Passing NULL as the second argument to to memcpy is undefined behavior even if the size is 0.
2017-09-04 22:23:42 -07:00
Neil Schemenauer db564238db Revert "bpo-17852: Maintain a list of BufferedWriter objects. Flush them on exit. (#1908)" (#3337)
This reverts commit e38d12ed34.
2017-09-04 22:13:17 -07:00
Neil Schemenauer e38d12ed34 bpo-17852: Maintain a list of BufferedWriter objects. Flush them on exit. (#1908)
* Maintain a list of BufferedWriter objects.  Flush them on exit.

In Python 3, the buffer and the underlying file object are separate
and so the order in which objects are finalized matters.  This is
unlike Python 2 where the file and buffer were a single object and
finalization was done for both at the same time.  In Python 3, if
the file is finalized and closed before the buffer then the data in
the buffer is lost.

This change adds a doubly linked list of open file buffers.  An atexit
hook ensures they are flushed before proceeding with interpreter
shutdown.  This is addition does not remove the need to properly close
files as there are other reasons why buffered data could get lost during
finalization.

Initial patch by Armin Rigo.

* Use weakref.WeakSet instead of WeakKeyDictionary.

* Simplify buffered double-linked list types.

* In _flush_all_writers(), suppress errors from flush().

* Remove NEWS entry, use blurb.
2017-09-04 20:18:38 -07:00
Raymond Hettinger 64263dfd18 Fix terminology in comment and add more design rationale. (#3335)
* Fix terminology in comment and add more design rationale.

* Fix extra space
2017-09-04 18:54:16 -07:00
Raymond Hettinger 550370957c Add comment to explain the implications of not sorting keywords (#3331)
In Python 3.6, sorted() was removed from _make_key() for the lru_cache and instead rely on guaranteed keyword argument order preservation.  This makes keyword argument handling faster but it also causes multiple callers with a different keyword argument order to be cached as separate items.  Depending on your point of view, this is either a performance regression (increased number of cache misses) or a performance enhancement (faster computation of keys).
2017-09-04 17:47:53 -07:00
Victor Stinner 759e30ec47 bpo-31170: Update libexpat from 2.2.3 to 2.2.4 (#3315)
* bpo-31170: Update libexpat from 2.2.3 to 2.2.4

Fix copying of partial characters for UTF-8 input (libexpat bug 115):
https://github.com/libexpat/libexpat/issues/115

* Add NEWS entry.
2017-09-05 01:58:08 +02:00
Eric Snow 86b7afdfee bpo-28411: Remove "modules" field from Py_InterpreterState. (#1638)
sys.modules is the one true source.
2017-09-04 17:54:09 -06:00
Raymond Hettinger f5ea83f486 random_triangular: sqrt() is more accurate than **0.5 (#3317) 2017-09-04 16:51:06 -07:00
Christian Heimes 8adc73c2c1 Travis: use ccache (#3307) 2017-09-05 01:48:54 +02:00
Benjamin Peterson 069306312a remove IRIX support (closes bpo-31341) (#3310)
See PEP 11.
2017-09-04 16:36:05 -07:00
Raymond Hettinger e1b0287c04 Code clean-up. Remove unnecessary pre-increment before the loop starts. (#3312) 2017-09-04 16:07:06 -07:00
Zachary Ware af64aff9f7 Regen Moduls/clinic/_ssl.c.h (GH-3320)
Broken in GH-2079
2017-09-04 15:45:18 -07:00
Serhiy Storchaka e503ca5288 bpo-30502: Fix handling of long oids in ssl. (#2909) 2017-09-05 00:28:53 +02:00
Zachary Ware f801322e92 Cache externals, depending on changes to PCbuild (#3308) 2017-09-04 14:59:02 -07:00
Melvyn Sopacua b2d096bd2a bpo-30622: Change NPN detection: (#2079)
* Change NPN detection:

Version breakdown, support disabled (pre-patch/post-patch):
- pre-1.0.1: OPENSSL_NPN_NEGOTIATED will not be defined -> False/False
- 1.0.1 and 1.0.2: OPENSSL_NPN_NEGOTIATED will not be defined ->
False/False
- 1.1.0+: OPENSSL_NPN_NEGOTIATED will be defined and
OPENSSL_NO_NEXTPROTONEG will be defined -> True/False

Version breakdown support enabled (pre-patch/post-patch):
- pre-1.0.1: OPENSSL_NPN_NEGOTIATED will not be defined -> False/False
- 1.0.1 and 1.0.2: OPENSSL_NPN_NEGOTIATED will be defined and
OPENSSL_NO_NEXTPROTONEG will not be defined -> True/True
- 1.1.0+: OPENSSL_NPN_NEGOTIATED will be defined and
OPENSSL_NO_NEXTPROTONEG will not be defined -> True/True

* Refine NPN guard:

- If NPN is disabled, but ALPN is available we need our callback
- Make clinic's ssl behave the same way

This created a working ssl module for me, with NPN disabled and ALPN
enabled for OpenSSL 1.1.0f.

Concerns to address:
The initial commit for NPN support into OpenSSL [1], had the
OPENSSL_NPN_* variables defined inside the OPENSSL_NO_NEXTPROTONEG
guard. The question is if that ever made it into a release.
This would need an ugly hack, something like:

	#if defined(OPENSSL_NO_NEXTPROTONEG) && \
		!defined(OPENSSL_NPN_NEGOTIATED)
	#	define OPENSSL_NPN_UNSUPPORTED 0
	#	define OPENSSL_NPN_NEGOTIATED 1
	#	define OPENSSL_NPN_NO_OVERLAP 2
	#endif

[1] https://github.com/openssl/openssl/commit/68b33cc5c7
2017-09-04 23:35:15 +02:00
Barry Warsaw 973b901212 What's New for bpo-1198569 (#3303) 2017-09-04 17:29:27 -04:00
Steve Dower d5cd21d75a Fixes doc/make.bat to properly handle quoted paths. (#3302) 2017-09-04 14:26:27 -07:00
Benjamin Peterson 14ce158e3d remove configure.ac support for SGI_ABI (#3294) 2017-09-04 14:05:32 -07:00
Benjamin Peterson 5b79d60d2c remote note about IRIX in aifc (#3299)
This comment hasn't been true since Python 3.0.
2017-09-04 13:32:34 -07:00
Barry Warsaw ba4279683f bpo-1198569: Allow string.Template braced pattern to be different (#3288)
* bpo-1198569: Allow the braced pattern to be different

``string.Template`` subclasses can optionally define ``braceidpattern`` if
they want to specify different placeholder patterns inside and outside the
braces.  If None (the default) it falls back to ``idpattern``.
2017-09-04 16:32:10 -04:00
larryhastings f9f17346d7 Blurbify master branch. (#3298)
Blurbify master branch.
2017-09-04 13:30:19 -07:00
Christian Heimes 002d64039b bpo-25674: remove sha256.tbs-internet.com ssl test (#3297)
Signed-off-by: Christian Heimes <christian@python.org>
2017-09-04 22:26:01 +02:00
R. David Murray 0c7983e4ad Clarify nature of parse_args 'args' argument. (#3292)
Patch by Paul.j3.  Includes an unrelated but useful addition to the
optparse porting section.
2017-09-04 16:17:26 -04:00
Raymond Hettinger f58e6e2768 Add references to modules I am responsible for (#3291) 2017-09-04 12:31:15 -07:00
Barry Warsaw 1a589a604f Use a team to maintain the email related packages. (#3290) 2017-09-04 15:19:26 -04:00
Raymond Hettinger 1bfbe78b03 Improve clarity (and small speed-up) by using tuple unpacking (#3289) 2017-09-04 11:47:58 -07:00
Benjamin Peterson 5ce1063345 remove check for bug last seem in Solaris 9 (#3285) 2017-09-04 10:52:51 -07:00
Alex Gaynor 3239cf1ae9 Change code owners for hashlib and ssl to the crypto team (#3284)
* Change code owners for hashlib and ssl to the crypto team

* Include the core CSPRNG for the crypto-team
2017-09-04 13:40:45 -04:00
Zhiming Wang 06de1aeff9 bpo-31281: Fix pathlib.Path incompatibility in fileinput (gh-3208)
Fix fileinput with inplace=True to accept pathlib.Path objects.
2017-09-04 13:37:24 -04:00
Benjamin Peterson a2344851ab remove autoconf check for select() (#3283)
We never actually check HAVE_SELECT.
2017-09-04 10:21:42 -07:00
Benjamin Peterson fc96f1e95e remove configure check for 'volatile' (#3281)
This is a required feature is C99, which we require.
2017-09-04 10:09:12 -07:00
Segev Finer 1c1f8f30c0 Add missing _sha3 module to Setup.dist (#2395) 2017-09-04 09:28:14 -07:00
Ned Deily 918edc0edb bpo-12383: Also ignore __PYVENV_LAUNCHER__ (#3278)
Used in macOS framework builds.
2017-09-04 00:00:21 -04:00
Gregory P. Smith 4f013881cb bpo-9146: add the missing NEWS entry. (#3275) 2017-09-03 14:08:48 -07:00
Antoine Pitrou 2ef37607b7 Fix a c.f.as_completed() refleak previously introduced in bpo-27144 (#3270) 2017-09-03 15:09:23 +02:00
Serhiy Storchaka bca4939d80 bpo-31185: Fixed miscellaneous errors in asyncio speedup module. (#3076) 2017-09-03 08:10:14 +03:00
Oren Milman 8df44ee8e0 remove a redundant lower in urllib.parse.urlsplit (#3008) 2017-09-02 21:51:39 -07:00
Victor Stinner 8687101589 bpo-31323: Fix reference leak in test_ssl (#3263)
Store exceptions as string rather than object to prevent reference
cycles which cause leaking dangling threads.
2017-09-02 00:26:17 +02:00
Victor Stinner e8a533fbc7 bpo-31250, test_asyncio: fix EventLoopTestsMixin.tearDown() (#3264)
Call doCleanups() to close the loop after calling
executor.shutdown(wait=True): see TestCase.set_event_loop() of
asyncio.test_utils.

Replace also gc.collect() with support.gc_collect().
2017-09-02 00:25:39 +02:00
Victor Stinner b713adf27a bpo-31326: ProcessPoolExecutor waits for the call queue thread (#3265)
* bpo-31326: ProcessPoolExecutor waits for the call queue thread

concurrent.futures.ProcessPoolExecutor.shutdown() now explicitly
closes the call queue. Moreover, shutdown(wait=True) now also join
the call queue thread, to prevent leaking a dangling thread.

* Fix for shutdown() being called twice.
2017-09-02 00:25:11 +02:00
Grzegorz Grzywacz 97e1b1c814 bpo-27144: concurrent.futures as_complete and map iterators do not keep reference to returned object (#1560)
* bpo-27144: concurrent.futures as_complie and map iterators do not keep
reference to returned object

* Some nits.  Improve wordings in docstrings and comments, and avoid relying on
sys.getrefcount() in tests.
2017-09-01 18:54:00 +02:00