Commit Graph

41454 Commits

Author SHA1 Message Date
Miss Islington (bot) c6ce8fba07 [3.6] bpo-31482: Missing bytes support for random.seed() version 1 (GH-3614) (GH-3659)
(cherry picked from commit 132a7d7cdb)
2017-09-19 10:56:33 -07:00
Miss Islington (bot) 72c05e31d6 [3.6] pythoninfo: ignore OSError(ENOSYS) on getrandom() (GH-3655) (#3657)
(cherry picked from commit a92941ff12)
2017-09-19 08:34:24 -07:00
Miss Islington (bot) f37dd11f0d [3.6] bpo-31293: Fix crashes in truediv and mul of a timedelta by a float with a bad as_integer_ratio() method. (GH-3227) (#3654)
(cherry picked from commit 865e4b4f63)
2017-09-19 17:00:44 +03:00
Miss Islington (bot) 99a51d4e5b [3.6] bpo-31315: Fix an assertion failure in imp.create_dynamic(), when spec.name is not a string. (GH-3257) (#3653)
(cherry picked from commit 9974e1bcf3)
2017-09-19 15:51:19 +03:00
Ned Deily 2f61f6417a Update pydoc topics and NEWS blurbs for 3.6.3rc1 2017-09-18 23:04:41 -04:00
Miss Islington (bot) 8afd7ab12d [3.6] bpo-31499, xml.etree: Fix xmlparser_gc_clear() crash (GH-3641) (#3645)
* bpo-31499, xml.etree: Fix xmlparser_gc_clear() crash

xml.etree: xmlparser_gc_clear() now sets self.parser to NULL to prevent a
crash in xmlparser_dealloc() if xmlparser_gc_clear() was called previously
by the garbage collector, because the parser was part of a reference cycle.

Co-Authored-By: Serhiy Storchaka <storchaka@gmail.com>
(cherry picked from commit e727d41ffc)
2017-09-18 05:48:23 -07:00
Miss Islington (bot) 84c89ef4e5 [3.6] bpo-30928: Update idlelib/NEWS.txt to 2017 Sep 17. (GH-3635) (#3637)
(cherry picked from commit 55679e0ec7)
2017-09-17 21:10:54 -04:00
Miss Islington (bot) 6b4d8ba097 [3.6] bpo-31502: IDLE Configdialog again deletes custom themes and keysets. (GH-3634) (#3636)
This reverses a never-released regression resulting from bpo-31287.
(cherry picked from commit 0efc7c67a2)
2017-09-17 20:39:24 -04:00
Miss Islington (bot) b417332bf4 [3.6] bpo-31493: Fix code context update and font update timers. (GH-3622) (#3623)
Canceling timers prevents a warning message when test_idle completes.
(This is the minimum fix needed before upcoming releases.)
(cherry picked from commit a6bb313c70)
2017-09-17 02:01:53 -04:00
Miss Islington (bot) 77b52e463a [3.6] bpo-31488: IDLE - update former extensions when options change. (GH-3612) (#3613)
When apply ConfigDialog changes, call .reload on each class with non-key options.
Change ParenMatch so that updates affect current instances.
(cherry picked from commit 5777ecc438)
2017-09-16 02:14:34 -04:00
Victor Stinner 2c1c2ca254 [3.6] bpo-31234: Join threads in tests (#3589)
* bpo-31234: Join threads in tests (#3572)

Call thread.join() on threads to prevent the "dangling threads"
warning.

(cherry picked from commit 18e95b4176)

* bpo-31234: Join threads in test_hashlib (#3573)

* bpo-31234: Join threads in test_hashlib

Use thread.join() to wait until the parallel hash tasks complete
rather than using events. Calling thread.join() prevent "dangling
thread" warnings.

* test_hashlib: minor PEP 8 coding style fixes

(cherry picked from commit 8dcf22f442)

* bpo-31234: Join threads in test_threading (#3579)

Call thread.join() to prevent the "dangling thread" warning.

(cherry picked from commit b8c7be2c52)

* bpo-31234: Join threads in test_queue (#3586)

Call thread.join() to prevent the "dangling thread" warning.

(cherry picked from commit 167cbde50a)

* bpo-31234: Join timers in test_threading (#3598)

Call the .join() method of threading.Timer timers to prevent the
"threading_cleanup() failed to cleanup 1 threads" warning.

(cherry picked from commit da3e5cf961)
2017-09-15 16:55:47 -07:00
Terry Jan Reedy 4d72945a28 [3.6] bpo-314777: IDLE - improve rstrip entry in doc (GH-3602) (#3605)
'Strip trailing whitespace' is not limited to spaces.  Wording caters to beginners who
do know know the meaning of 'whitespace'.  Multiline string literals are not skipped.
(cherry picked from commit ff70289)
2017-09-15 15:09:17 -04:00
Terry Jan Reedy 93d5f91fff [3.6] bpo-31462: IDLE - remove trailing whitespaces (GH-3564) (#3594)
Reproduction of Idlelib changes in Serhiy's 3.7 patch.
2017-09-14 22:52:16 -04:00
Miss Islington (bot) 7b62416d86 [3.6] bpo-31480: IDLE - fix tests to pass with zzdummy extension disabled. (GH-3590) (#3591)
Enabled by default was a temporary expedient.  The fix is to add a user override to enable.
(cherry picked from commit d384a81f55)
2017-09-14 20:34:42 -04:00
Miss Islington (bot) 49caab46f6 [3.6] bpo-31455: Fix an assertion failure in ElementTree.XMLParser(). (GH-3545) (#3585)
* Avoid calling "PyObject_GetAttrString()" (and potentially executing user code) with a live exception set.

* Ignore only AttributeError on attribute lookups in ElementTree.XMLParser() and propagate all other exceptions.
(cherry picked from commit c8d8e15bfc)
2017-09-15 02:13:21 +03:00
Miss Islington (bot) 1658ec0757 [3.6] bpo-28556: typing.get_type_hints: better globalns for classes and modules (GH-3582) (#3583)
This makes the default behavior (without specifying `globalns` manually) more
predictable for users, finds the right globalns automatically.

Implementation for classes assumes has a `__module__` attribute and that module
is present in `sys.modules`.  It does this recursively for all bases in the
MRO.  For modules, the implementation just uses their `__dict__` directly.

This is backwards compatible, will just raise fewer exceptions in naive user
code.

Originally implemented and reviewed at https://github.com/python/typing/pull/470.
(cherry picked from commit f350a268a7)
2017-09-14 16:52:05 -04:00
Miss Islington (bot) f135f62cfd [3.6] bpo-31471: Fix assertion failure in subprocess.Popen() on Windows, in case env has a bad keys() method. (GH-3580) (#3584)
(cherry picked from commit 0b3a87ef54)
2017-09-14 22:56:31 +03:00
Miss Islington (bot) 20fa05d022 [3.6] bpo-31457: Allow for nested LoggerAdapter objects (GH-3551) (#3576)
Some of the proxied methods use internal Logger state which isn't proxied,
causing failures if an adapter is applied to another adapter.

This commit fixes the issue, adds a new test for the use case.
(cherry picked from commit 1bbd482bcf)
2017-09-14 13:10:25 -04:00
Miss Islington (bot) 9e3cd78ec1 [3.6] bpo-28556: Minor updates to typing module (GH-3550) (#3558)
* Copy changes to typing from upstream repo
* Add NEWS entry
(cherry picked from commit 65bc62052f)
2017-09-13 20:10:53 -04:00
Victor Stinner ef323e8d82 [3.6] bpo-31234: Fix dangling thread in test_ftp/poplib (#3554)
* bpo-31234: Fix dangling thread in test_ftp/poplib (#3540)

Explicitly clear the server attribute in test_ftplib and test_poplib
to prevent dangling thread.

(cherry picked from commit d403a29c00)

* bpo-31234: Fix dangling thread in test_ftplib (#3544)

Clear also self.server_thread attribute in TestTimeouts.tearDown().

(cherry picked from commit b157ce1e58)
2017-09-13 15:56:14 -07:00
Miss Islington (bot) d99e85b9f6 [3.6] bpo-31234, socket.create_connection(): Fix ref cycle (GH-3546) (#3552)
(cherry picked from commit acb9fa79fa)
2017-09-13 15:54:34 -07:00
Miss Islington (bot) 769ddb075a [3.6] bpo-31448, test_poplib: Fix ResourceWarning (GH-3542) (#3543)
Call POP3.close(), don't close close directly the sock attribute.
(cherry picked from commit d165e14e29)
2017-09-13 06:09:44 -07:00
Miss Islington (bot) 6c25b73194 [3.6] bpo-31234: test_httpservers joins the server thread (GH-3188) (#3536)
(cherry picked from commit 830d7d2936)
2017-09-13 03:27:54 -07:00
Miss Islington (bot) 89bfc9b0d9 [3.6] bpo-31234: test_threaded_import: fix test_side_effect_import() (GH-3189) (#3537)
* Don't leak the module into sys.modules
* Avoid dangling thread
(cherry picked from commit 41bbd82b6b)
2017-09-13 03:27:45 -07:00
Miss Islington (bot) 1b00bddd5c [3.6] bpo-31323: Fix reference leak in test_ssl (GH-3263) (#3538)
Store exceptions as string rather than object to prevent reference
cycles which cause leaking dangling threads.
(cherry picked from commit 8687101589)
2017-09-13 03:27:34 -07:00
Miss Islington (bot) 94eb2d5b73 [3.6] bpo-31249: Fix test_concurrent_futures dangling thread (GH-3521) (#3522)
ProcessPoolShutdownTest.test_del_shutdown() now closes the call queue
and joins its thread, to prevent leaking a dangling thread.
(cherry picked from commit 3bcf157c11)
2017-09-12 17:43:44 -07:00
Miss Islington (bot) bcf042ff98 [3.6] bpo-31234: Enhance test_thread.test_forkinthread() (GH-3516) (#3519)
* test_thread.test_forkinthread() now waits until the thread completes.
* Check the status in the test method, not in the thread function
* Don't ignore RuntimeError anymore: since the commit
  346cbd351e (bpo-16500,
  os.register_at_fork(), os.fork() cannot fail anymore with
  RuntimeError.
* Replace 0.01 literal with a new POLL_SLEEP constant
* test_forkinthread(): test if os.fork() exists rather than testing
  the platform.
(cherry picked from commit a15d155aad)
2017-09-12 16:14:09 -07:00
Victor Stinner 5013a5ebc9 [3.6] bpo-31250: test_asyncio: fix dangling threads (#3517)
* bpo-31250, test_asyncio: fix dangling threads (#3252)

* Explicitly call shutdown(wait=True) on executors to wait until all
  threads complete to prevent side effects between tests.
* Fix test_loop_self_reading_exception(): don't mock loop.close().
  Previously, the original close() method was called rather than the
  mock, because how set_event_loop() registered loop.close().

(cherry picked from commit 16432beadb)

* 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().

(cherry picked from commit e8a533fbc7)
2017-09-12 14:18:23 -07:00
Miss Islington (bot) 4d7807ab9a [3.6] bpo-31421: Document how IDLE runs tkinter programs. (GH-3513) (#3514)
IDLE calls tcl/tk update in the background in order to make live
interaction and experimentatin with tkinter applications much easier.
(cherry picked from commit 98758bc67f)
2017-09-12 09:44:59 -04:00
Miss Islington (bot) 01dcaa5c99 [3.6] bpo-27099: Finish updating IDLE doc and help text. (GH-3510) (#3511)
As needed for the conversion of extensions to features.
(cherry picked from commit adb4cd2a2a)
2017-09-12 08:23:38 -04:00
Serhiy Storchaka 9adc87b0f8 [3.6] bpo-31416: Fix assertion failures in case of a bad warnings.filters or warnings.defaultaction. (GH-3496) (#3509)
Patch by Oren Milman..
(cherry picked from commit 9d984fd2b0)
2017-09-12 09:48:27 +03:00
Benjamin Peterson cb356c2ecc [3.6] bpo-31373: remove overly strict float range checks (GH-3486) (#3495)
This undoes a853a8ba78 except for the pytime.c
parts. We want to continue to allow IEEE 754 doubles larger than FLT_MAX to be
rounded into finite floats. Tests were added to very this behavior.
(cherry picked from commit 2bb69a5b4e)
2017-09-11 23:08:49 -07:00
Miss Islington (bot) 99b941b420 [3.6] bpo-30928: Update idlelib/NEWS.txt to 2017-09-11. (GH-3503) (#3504)
(cherry picked from commit 8239fd7046)
2017-09-11 17:50:40 -04:00
Miss Islington (bot) 31b242459c [3.6] bpo-31414: IDLE -- fix tk entry box tests by deleting first. (GH-3501) (#3502)
Adding to an int entry is not the same as deleting and inserting
because int('') will fail.
(cherry picked from commit 667522efa8)
2017-09-11 16:34:11 -04:00
Serhiy Storchaka 7972ed2111 [3.6] bpo-31411: Prevent raising a SystemError in case warnings.onceregistry is not a dictionary. (GH-3485). (#3494)
(cherry picked from commit 252033d50e)
2017-09-11 10:01:47 +03:00
Miss Islington (bot) 4a8b53a208 [3.6] bpo-30781: IDLE: Fix help button on configdialog (GH-3238) (#3489)
This fixes an omission in the ttk conversion patch for this issue, hence no new news.
Patch by Cheryl Sabella.
(cherry picked from commit 3866d9bbcf)
2017-09-10 23:19:35 -04:00
Henk-Jaap Wagenaar 2a0f7c34c3 Backport docstring improvements to OrderedDict. (GH-3470) 2017-09-10 18:11:18 -07:00
Terry Jan Reedy d6c397bf77 [3.6] bpo-27099: IDLE - Convert built-in extensions to regular features (GH-2494) (#3487)
About 10 IDLE features were implemented as supposedly optional
extensions.  Their different behavior could be confusing or worse for
users and not good for maintenance.  Hence the conversion.

The main difference for users is that user configurable key bindings
for builtin features are now handled uniformly.  Now, editing a binding
in a keyset only affects its value in the keyset.  All bindings are
defined together in the system-specific default keysets in config-
extensions.def.  All custom keysets are saved as a whole in config-
extension.cfg.  All take effect as soon as one clicks Apply or Ok.

The affected events are '<<force-open-completions>>', '<<expand-word>>',
'<<force-open-calltip>>', '<<flash-paren>>', '<<format-paragraph>>',
'<<run-module>>', '<<check-module>>', and '<<zoom-height>>'.  Any
(global) customizations made before 3.6.3 will not affect their keyset-
specific customization after 3.6.3. and vice versa.

Inital patch by Charles Wohlganger, revised by Terry Jan Reedy.
(cherry picked from commit 58fc71c)
2017-09-10 20:30:46 -04:00
Miss Islington (bot) a4baf1c543 [3.6] bpo-26669: Fix nan arg value error in pytime.c (GH-3085) (GH-3467)
* Modify NaN check function and error message
* Fix pytime.c when arg is nan
* fix whitespace
(cherry picked from commit 829dacce4f)
2017-09-08 21:53:04 -07:00
Miss Islington (bot) 3892799668 [3.6] bpo-30822: Deduplicate ZoneInfoTest classes in test_datetime. (GH-2534) (#3405)
(cherry picked from commit 34b54873b5)
2017-09-08 15:44:33 -07:00
Christian Heimes 9f2b3d4c28 [3.6] bpo-29136: Add TLS 1.3 cipher suites and OP_NO_TLSv1_3 (GH-1363) (#3444)
* bpo-29136: Add TLS 1.3 support

TLS 1.3 introduces a new, distinct set of cipher suites. The TLS 1.3
cipher suites don't overlap with cipher suites from TLS 1.2 and earlier.
Since Python sets its own set of permitted ciphers, TLS 1.3 handshake
will fail as soon as OpenSSL 1.1.1 is released. Let's enable the common
AES-GCM and ChaCha20 suites.

Additionally the flag OP_NO_TLSv1_3 is added. It defaults to 0 (no op) with
OpenSSL prior to 1.1.1. This allows applications to opt-out from TLS 1.3
now.

Signed-off-by: Christian Heimes <christian@python.org>.
(cherry picked from commit cb5b68abde)
2017-09-07 20:23:52 -07:00
Christian Heimes 9423f5d688 [3.6] bpo-27340: Use memoryview in SSLSocket.sendall() (GH-3384) (#3434)
* bpo-27340: Use memoryview in SSLSocket.sendall()

SSLSocket.sendall() now uses memoryview to create slices of data. This fix
support for all bytes-like object. It is also more efficient and avoids
costly copies.

Signed-off-by: Christian Heimes <christian@python.org>

* Cast view to bytes, fix typo

Signed-off-by: Christian Heimes <christian@python.org>.
(cherry picked from commit 888bbdc192)
2017-09-07 16:59:17 -07:00
Miss Islington (bot) fb4c28c032 [3.6] bpo-22635: Update the getstatusoutput docstring. (GH-3435) (#3439)
To match the documentation updates already made.
Also renames the local variable used within to match
what it actually holds.
(cherry picked from commit 2eb0cb4787)
2017-09-07 16:44:58 -07:00
Steve Dower 76006f285a [3.6] bpo-30389 Adds detection of VS 2017 to distutils._msvccompiler GH-1632 (#3425) 2017-09-07 13:58:07 -07:00
Miss Islington (bot) aa1afc72c1 bpo-30465: Fix lineno and col_offset in fstring AST nodes (GH-1800) (gh-3409)
For f-string ast nodes, fix the line and columns so that tools such as flake8 can identify them correctly.
(cherry picked from commit e7c566caf1)
2017-09-06 19:43:04 -07:00
Miss Islington (bot) e29ab7e751 [3.6] bpo-30824: Add mimetype for .json (GH-3048) (#3401)
(cherry picked from commit 8204b90368)
2017-09-06 20:04:14 -04:00
Steve Dower fd645ec6f5 [3.6] bpo-31340: Change to building with MSVC v141 (included with Visual Studio 2017) (GH-3311) (#3386) 2017-09-06 15:55:25 -07:00
Gregory P. Smith 3bad1650a0 [3.6] bpo-31178: Avoid concatenating bytes with str in subprocess error (GH-3066) (#3388)
Avoid concatenating bytes with str in the typically rare subprocess error path (exec failed). Includes a mock based unittest to exercise the codepath.
(cherry picked from commit 3fc499bca1)
2017-09-06 13:34:17 -07:00
Miss Islington (bot) 3aea3c298b [3.6] Stop test_xmlrpc from writing to sys.stderr (GH-3359) (#3380)
One test case of test_xmlrpc uses HTTPServer with a subclass of
BaseHTTPRequestHandler. The BaseRequestHandler class logs to
sys.stderr by default. Override log_message() to not clobber
test output.

Signed-off-by: Christian Heimes <christian@python.org>
(cherry picked from commit 3463ee3972)
2017-09-06 10:22:14 -07:00
Christian Heimes 6da379bde3 [3.6] bpo-29781: Fix SSLObject.version before handshake (GH-3364) (#3381)
SSLObject.version() now correctly returns None when handshake over BIO has
not been performed yet.

Signed-off-by: Christian Heimes <christian@python.org>
(cherry picked from commit 6877111)
2017-09-06 06:42:30 -07:00