Commit Graph

22010 Commits

Author SHA1 Message Date
Serhiy Storchaka 87db4d343c
[3.7] bpo-38405: Make nested subclasses of typing.NamedTuple pickleable. (GH-16641). (GH-16674)
(cherry picked from commit 13abda4100)
2019-10-09 12:56:32 +03:00
Miss Islington (bot) 056fa7f52a
bpo-36953: Delay removal of ABCs from collections. (GH-13409)
Bump the removal to 3.9, indicate collections.abc available since 3.3,
replace version-changed directive to deprecated-removed.

https://bugs.python.org/issue36953
(cherry picked from commit eea47e0939)

Co-authored-by: Matthias Bussonnier <mbussonnier@ucmerced.edu>
2019-10-09 02:29:31 -07:00
Ricardo Bánffy 43f5c0c4d0 [3.7] bpo-38294: Add list of no-longer-escaped chars to re.escape documentation. (GH-16442) (GH-16647)
Prior to 3.7, re.escape escaped many characters that don't have
special meaning in Python, but that use to require escaping in other
tools and languages. This commit aims to make it clear which characters
were, but are no longer escaped.
(cherry picked from commit 15ae75d660)
2019-10-08 19:41:00 +03:00
Miss Islington (bot) 98043b4fcd
bpo-38118: Ignore Valgrind false alarm in PyUnicode_Decode() (GH-16651)
Valgrind emits "Conditional jump or move depends on uninitialised
value(s)" false alarms on GCC builtin strcmp() function. The GCC code
is correct.

Valgrind bug: https://bugs.kde.org/show_bug.cgi?id=264936
(cherry picked from commit 03ab6b4fc6)

Co-authored-by: Victor Stinner <vstinner@python.org>
2019-10-08 06:56:08 -07:00
Miss Islington (bot) 4f962ecfa1
bpo-36698: IDLE no longer fails when write non-encodable characters to stderr. (GH-16583)
It now escapes them with a backslash, as the regular Python interpreter.
Added the "errors" field to the standard streams.
(cherry picked from commit b690a2759e)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2019-10-08 04:52:48 -07:00
Miss Islington (bot) bfb5f9a66c
bpo-38344: Fix syntax in activate.bat (GH-16533)
(cherry picked from commit e310af9e29)

Co-authored-by: James Abel <j@abel.co>
2019-10-07 14:25:06 -07:00
Miss Islington (bot) 6c3fbbc177
bpo-13153: Use OS native encoding for converting between Python and Tcl. (GH-16545)
On Windows use UTF-16 (or UTF-32 for 32-bit Tcl_UniChar) with the
"surrogatepass" error handler for converting to/from Tcl Unicode objects.

On Linux use UTF-8 with the "surrogateescape" error handler for converting
to/from Tcl String objects.

Converting strings from Tcl to Python and back now never fails
(except MemoryError).
(cherry picked from commit 06cb94bc84)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2019-10-04 03:28:53 -07:00
Ned Deily 4082f600a5 3.7.5rc1 2019-10-01 13:23:17 -04:00
Miss Islington (bot) 1c3e4691bb
bpo-38019: correctly handle pause/resume reading of closed asyncio unix pipe (GH-16472)
(cherry picked from commit 58498bc717)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
2019-09-29 05:19:11 -07:00
Jason R. Coombs 80dd66ac27
[3.7] bpo-38216, bpo-36274: Allow subclasses to separately override validation and encoding behavior (GH-16448) (GH-16461)
* bpo-38216: Allow bypassing input validation

* bpo-36274: Also allow the URL encoding to be overridden.

* bpo-38216, bpo-36274: Add tests demonstrating a hook for overriding validation, test demonstrating override encoding, and a test to capture expectation of the interface for the URL.

* Call with skip_host to avoid tripping on the host checking in the URL.

* Remove obsolete comment.

* Make _prepare_path_encoding its own attr.

This makes overriding just that simpler.

Also, don't use the := operator to make backporting easier.

* Add a news entry.

* _prepare_path_encoding -> _encode_prepared_path()

* Once again separate the path validation and request encoding, drastically simplifying the behavior. Drop the guarantee that all processing happens in _prepare_path..
(cherry picked from commit 7774d7831e)

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
2019-09-28 09:15:05 -04:00
Miss Islington (bot) 6112b91bb8 bpo-38301: In Solaris family, we must be sure to use '-D_REENTRANT' (GH-16446) (#16450)
(cherry picked from commit 52d1b86bde)

Co-authored-by: Jesús Cea <jcea@jcea.es>
2019-09-28 04:21:24 +02:00
Miss Islington (bot) 39a0c75555
bpo-38243, xmlrpc.server: Escape the server_title (GH-16373)
Escape the server title of xmlrpc.server.DocXMLRPCServer
when rendering the document page as HTML.
(cherry picked from commit e8650a4f8c)

Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
2019-09-27 13:18:14 -07:00
Christian Heimes 2c24f2cae0
[3.7] bpo-38275: Skip ssl tests for disabled versions (GH-16427)
test_ssl now handles disabled TLS/SSL versions better. OpenSSL's crypto
policy and run-time settings are recognized and tests for disabled versions
are skipped.

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

https://bugs.python.org/issue38275
(cherry picked from commit df6ac7e2b8)
2019-09-26 22:54:33 +02:00
Victor Stinner e6b5ed1fbd
bpo-38239: Fix test_gdb for Link Time Optimization (LTO) (GH-16422) (GH-16426)
(cherry picked from commit 64b4a3a2de)
2019-09-26 17:30:14 +02:00
Benjamin Peterson 8e4622ea89
[3.7] closes bpo-38174: Update vendored expat library to 2.2.8. (GH-16407)
Fixes CVE-2019-15903. See full changelog at https://github.com/libexpat/libexpat/blob/R_2_2_8/expat/Changes..
(cherry picked from commit 52b9408038)

Co-authored-by: Benjamin Peterson <benjamin@python.org>
2019-09-25 21:54:59 -07:00
Miss Islington (bot) 585798fb0e
bpo-38271: encrypt private key test files with AES256 (GH-16385)
The private keys for test_ssl were encrypted with 3DES in traditional
PKCSGH-5 format. 3DES and the digest algorithm of PKCSGH-5 are blocked by
some strict crypto policies. Use PKCSGH-8 format with AES256 encryption
instead.

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

https://bugs.python.org/issue38271

Automerge-Triggered-By: @tiran
(cherry picked from commit bfd0c963d8)

Co-authored-by: Christian Heimes <christian@python.org>
2019-09-25 09:12:59 -07:00
Gregory P. Smith 4042e1afd2
[3.7] bpo-36871: Handle spec errors in assert_has_calls (GH-16364) (GH-16374)
Handle spec errors in assert_has_calls (GH-16005) (GH-16364)

The fix in PR 13261 handled the underlying issue about the spec for specific methods not being applied correctly, but it didn't fix the issue that was causing the misleading error message.

The code currently grabs a list of responses from _call_matcher (which may include exceptions). But it doesn't reach inside the list when checking if the result is an exception. This results in a misleading error message when one of the provided calls does not match the spec.

https://bugs.python.org/issue36871

Co-authored-by: Samuel Freilich <sfreilich@google.com>

(cherry picked from commit 1a17a054f6)
2019-09-24 22:29:17 -07:00
Miss Islington (bot) 46f6c566a8
bpo-37123: multiprocessing test_mymanager() accepts SIGTERM (GH-16349)
Multiprocessing test test_mymanager() now also expects -SIGTERM, not
only exitcode 0.

bpo-30356: BaseManager._finalize_manager() sends SIGTERM to the
manager process if it takes longer than 1 second to stop, which
happens on slow buildbots.
(cherry picked from commit b0e1ae5f54)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2019-09-24 05:38:38 -07:00
Miss Islington (bot) c13a4d6a94
bpo-38212: Increase MP test_queue_feeder_donot_stop_onexc() timeout (GH-16348)
Multiprocessing tests: increase test_queue_feeder_donot_stop_onexc()
timeout from 1 to 60 seconds.
(cherry picked from commit 99799c7220)

Co-authored-by: Victor Stinner <vstinner@python.org>
2019-09-24 04:06:05 -07:00
Miss Islington (bot) fd4f28d894
bpo-37937: Mention frame.f_trace in sys.settrace docs (GH-15439)
Mention frame.f_trace in sys.settrace docs, as well as the fact you still
need to call `sys.settrace` to enable the tracing machinery before setting
`frame.f_trace` will have any effect.
(cherry picked from commit 9c2682efc6)

Co-authored-by: Ram Rachum <ram@rachum.com>
2019-09-20 08:25:12 -07:00
Serhiy Storchaka 69b3718b18
[3.7] bpo-38191: Accept arbitrary keyword names in NamedTuple(). (GH-16222) (GH-16239)
This includes such names as "cls", "self", "typename" and "fields".
(cherry picked from commit 2bf31ccab3)
2019-09-17 22:09:09 +03:00
Miss Islington (bot) fc022f04b4
bpo-38013: make async_generator_athrow object tolerant to throwing exceptions (GH-16070)
Even when the helper is not started yet.

This behavior follows conventional generator one.
There is no reason for `async_generator_athrow` to handle `gen.throw()` differently.

https://bugs.python.org/issue38013
(cherry picked from commit c275312a62)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
2019-09-17 06:19:25 -07:00
Miss Islington (bot) 80cb055aa4
bpo-38185: Fixed case-insensitive string comparison in sqlite3.Row indexing. (GH-16190)
(cherry picked from commit f669581a95)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2019-09-16 23:39:49 -07:00
Miss Islington (bot) 3d916a7b1e
bpo-35379: When exiting IDLE, catch any AttributeError. (GH-16212)
One happens when EditorWindow.close is called twice.
Printing a traceback, when IDLE is run from a terminal,
is useless and annoying.
(cherry picked from commit dfd34a9cd5)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2019-09-16 23:24:02 -07:00
Miss Islington (bot) 4ac1be2828
bpo-38175: Fix a memory leak in comparison of sqlite3.Row objects. (GH-16155)
(cherry picked from commit 8debfa5040)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2019-09-16 23:14:30 -07:00
Miss Islington (bot) 523497cbdc
bpo-38183: Test_idle ignores user config directory GH-16198)
It no longer tries to create or access .idlerc or any files within.
Users must run IDLE to discover problems with saving settings.
(cherry picked from commit 0048afc16a)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2019-09-16 20:33:06 -07:00
Miss Islington (bot) c55f69552c
[3.7] bpo-33936: Don't call obsolete init methods with OpenSSL 1.1.0+ (GH-16140) (GH-16200)
``OPENSSL_VERSION_1_1`` was never defined in ``_hashopenssl.c``. 


https://bugs.python.org/issue33936
(cherry picked from commit 724f1a5723)


Co-authored-by: Christian Heimes <christian@python.org>


https://bugs.python.org/issue33936



Automerge-Triggered-By: @tiran
2019-09-16 12:49:07 -07:00
Steve Dower 76d8fb7716
bpo-38117: Update bundled Windows OpenSSL to 1.1.1d (GH-16184) 2019-09-16 15:55:07 +01:00
Miss Islington (bot) 26c44b5144
bpo-38117: Updated OpenSSL to 1.1.1d in macOS installer. (GH-16170)
(cherry picked from commit 24d1597e43)

Co-authored-by: Ned Deily <nad@python.org>
2019-09-15 19:56:04 -07:00
Miss Islington (bot) 3906920cfe bpo-34706: Preserve subclassing in inspect.Signature.from_callable (GH-16108) (GH-16114)
https://bugs.python.org/issue34706

Specifically in the case of a class that does not override its
constructor signature inherited from object.

These are Buck Evan @bukzor's changes cherrypicked from GH-9344.
(cherry picked from commit 5b9ff7a0dc)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2019-09-13 18:42:53 +01:00
Miss Islington (bot) d112ea66b0
closes bpo-36002: Use AC_PATH_TOOL to find llvm-profdata and llvm-ar. (GH-14998)
(cherry picked from commit 0519d497b0)

Co-authored-by: Doyle Rowland <doyle.rowland@reliaqual.com>
2019-09-13 06:55:11 -07:00
Xtreak e7b7edf5eb [3.7] bpo-12144: Handle cookies with expires attribute in CookieJar.make_cookies (GH-13921) (GH-16092)
* [3.7] bpo-12144: Handle cookies with expires attribute in CookieJar.make_cookies (GH-13921)

Handle time comparison for cookies with `expires` attribute when `CookieJar.make_cookies` is called.

Co-authored-by: Demian Brecht <demianbrecht@gmail.com>

https://bugs.python.org/issue12144

Automerge-Triggered-By: @asvetlov
(cherry picked from commit bb41147)

Co-authored-by: Xtreak <tir.karthi@gmail.com>

* Use warnings module instead of test.support.check_no_warnings

* [3.7] bpo-12144: Handle cookies with expires attribute in CookieJar.make_cookies (GH-13921)

Handle time comparison for cookies with `expires` attribute when `CookieJar.make_cookies` is called.

Co-authored-by: Demian Brecht <demianbrecht@gmail.com>

https://bugs.python.org/issue12144

Automerge-Triggered-By: @asvetlov.
(cherry picked from commit bb41147eab)

Co-authored-by: Xtreak <tir.karthi@gmail.com>
2019-09-13 15:22:12 +03:00
Julien Palard f14fcbf299
Revert "bpo-37785: Fix xgettext warning in argparse (GH-15161)" (GH-16082)
This reverts commit b50eff6590 because
it's an incompatible change that would have broken the existing
translations.
2019-09-13 12:20:14 +02:00
Miss Islington (bot) b50eff6590
bpo-37785: Fix xgettext warning in argparse (GH-15161)
(cherry picked from commit 42671aea2d)

Co-authored-by: Jakub Kulík <Kulikjak@gmail.com>
2019-09-13 02:44:04 -07:00
Miss Islington (bot) 7da8c0aee2
closes bpo-37803: pdb: fix handling of options (--help / --version) (GH-15193)
The "--" should not be included with long options passed to
getopt.getopt.

Fixes https://bugs.python.org/issue37803
(cherry picked from commit 855df7f273)

Co-authored-by: Daniel Hahler <github@thequod.de>
2019-09-12 09:04:34 -07:00
Miss Islington (bot) a3c53a1b45
bpo-21872: fix lzma library decompresses data incompletely (GH-14048)
* 1. add test case with wrong behavior
* 2. fix bug when max_length == -1
* 3. allow b"" as valid input data for decompress_buf()
* 4. when max_length >= 0, let needs_input mechanism works
* add more asserts to test case
(cherry picked from commit 4ffd05d7ec)

Co-authored-by: animalize <animalize@users.noreply.github.com>
2019-09-12 07:41:30 -07:00
Miss Islington (bot) c8d1338441
bpo-26868: Fix example usage of PyModule_AddObject. (GH-15725)
* Add a note to the PyModule_AddObject docs.

* Correct example usages of PyModule_AddObject.

* Whitespace.

* Clean up wording.

* 📜🤖 Added by blurb_it.

* First code review.

* Add < 0 in the tests with PyModule_AddObject
(cherry picked from commit 224b8aaa7e)

Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
2019-09-12 05:29:09 -07:00
Miss Islington (bot) 8892a1d685
closes bpo-38124: Fix bounds check in PyState_AddModule. (GH-16007)
The >=, checking whether a module index was in already in the module-by-index list, needed to be strict.

Also, fold nested ifs into one and fix some bad spacing.
(cherry picked from commit 39de95b746)

Co-authored-by: Benjamin Peterson <benjamin@python.org>
2019-09-11 17:02:50 -07:00
Miss Islington (bot) e4be7c8ba1 Improve clarity of try-return-finally-return (GH-15677) (GH-15982)
Clarify execution in try-return-finally-return case.
(cherry picked from commit 0cc27417f2)

Co-authored-by: toonarmycaptain <toonarmycaptain@hotmail.com>
2019-09-11 19:42:09 +02:00
Stéphane Wirtel cec68c31e8 [3.7] bpo-38117: Test with OpenSSL 1.1.1d (GH-15983) (GH-15994)
Signed-off-by: Christian Heimes <christian@python.org>.
(cherry picked from commit 58ab13479d)

Co-authored-by: Christian Heimes <christian@python.org>


https://bugs.python.org/issue38117



Automerge-Triggered-By: @matrixise
2019-09-11 10:36:06 -07:00
Miss Islington (bot) d126fbddc9 bpo-37885: venv: Don't produce unbound variable warning on deactivate (GH-15974)
Before, running deactivate from a bash shell configured to treat undefined variables as errors (`set -u`) would produce a warning:

```
$ python3 -m venv test
$ source test/bin/activate
(test) $ deactivate
-bash: $1: unbound variable
```
(cherry picked from commit 5209e586b7)

Co-authored-by: Daniel Abrahamsson <hamsson@gmail.com>
2019-09-11 08:56:27 -07:00
Miss Islington (bot) 8a19a91e28
bpo-36634: Fixes activate.bat when existing values contain double quotes (GH-15924)
(cherry picked from commit 574b324bdc)

Co-authored-by: Steve Dower <steve.dower@python.org>
2019-09-11 08:23:07 -07:00
Miss Islington (bot) c211939948 bpo-36919: make test_source_encoding.test_issue2301 implementation-independent (GH-13639) (GH-15953)
* bpo-36919: make test_issue2301 implementation-independent
(cherry picked from commit b6643dcfc2)

Co-authored-by: Pavel Koneski <pavel.koneski@gmail.com>
2019-09-11 15:36:36 +01:00
Miss Islington (bot) f3480ad088
[3.8] bpo-37409: fix relative import with no parent (GH-14956) (GH-15913)
Relative imports use resolve_name to get the absolute target name,
which first seeks the current module's absolute package name from the globals:
If __package__ (and __spec__.parent) are missing then
import uses __name__, truncating the last segment if
the module is a submodule rather than a package __init__.py
(which it guesses from whether __path__ is defined).

The __name__ attempt should fail if there is no parent package (top level modules),
if __name__ is '__main__' (-m entry points), or both (scripts).
That is, if both __name__ has no subcomponents and the module does not seem
to be a package __init__ module then import should fail..
(cherry picked from commit 92420b3e67)

Co-authored-by: Ben Lewis <benjimin@users.noreply.github.com>
(cherry picked from commit 0a6693a469)

Co-authored-by: Brett Cannon <54418+brettcannon@users.noreply.github.com>
2019-09-11 05:50:14 -07:00
Vinay Sajip aca878ecf1
[3.7] bpo-35168: Make shlex.punctuation_chars read-only (GH-11631) (GH-15926)
(cherry picked from commit 972cf5c06a)

Co-authored-by: Alex <a.v.shkop@gmail.com>
2019-09-11 13:39:08 +01:00
Miss Islington (bot) 99f0e81f43
bpo-20504 : in cgi.py, fix bug when a multipart/form-data request has… (GH-10638)
* bpo-20504 : in cgi.py, fix bug when a multipart/form-data request has no content-length header

* Add Misc/NEWS.d/next file.

* Add rst formatting for NEWS.d/next file

* Reaplce assert by self.assertEqual
(cherry picked from commit 2d7cacacc3)

Co-authored-by: Pierre Quentel <pierre.quentel@gmail.com>
2019-09-11 05:22:38 -07:00
Miss Islington (bot) 5fe153c21d
bpo-37424: Avoid a hang in subprocess.run timeout output capture (GH-14490)
Fixes a possible hang when using a timeout on subprocess.run() while
capturing output. If the child process spawned its own children or otherwise
connected its stdout or stderr handles with another process, we could hang
after the timeout was reached and our child was killed when attempting to read
final output from the pipes.
(cherry picked from commit 580d2782f7)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2019-09-11 03:05:58 -07:00
Steve Dower 6a494e77fc
bpo-38089: Move Azure Pipelines to latest VM versions and make macOS tests optional (GH-15851) 2019-09-10 18:06:38 +01:00
Victor Stinner 494b61aeec
[3.7] bpo-37531: Enhance regrtest multiprocess timeout (GH-15345) (GH-15874)
bpo-37531: Enhance regrtest multiprocess timeout (GH-15345)

* Write a message when killing a worker process
* Put a timeout on the second popen.communicate() call
  (after killing the process)
* Put a timeout on popen.wait() call
* Catch popen.kill() and popen.wait() exceptions

(cherry picked from commit de2d9eed8b)
2019-09-10 17:54:40 +02:00
Steve Dower 0fccd4ab5b
bpo-38088: Fixes distutils not finding vcruntime140.dll with only v142 toolset installed (GH-15849) 2019-09-10 15:18:02 +01:00
Steve Dower 0d7e6a6d2d
bpo-38087: Fix case sensitivity in test_pathlib and test_ntpath (GH-15850) 2019-09-10 15:17:42 +01:00
Michael Felt 61f34f9f63 bpo-34720: Fix test_importlib.test_bad_traverse for AIX (GH-14238) 2019-09-10 14:30:18 +01:00
Miss Islington (bot) 64947dc81a
bpo-38077: IDLE no longer adds 'argv' to the user namespace (GH-15818)
This only happened when initializing the subprocess to run a module.
This recent bug only affected 3.7.4 and 3.8.0b2 to 3.8.0b4.
(cherry picked from commit c59295a1ca)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2019-09-09 20:33:24 -07:00
Victor Stinner 23669330b7
bpo-38006: Avoid closure in weakref.WeakValueDictionary (GH-15641) (GH-15789)
weakref.WeakValueDictionary defines a local remove() function used as
callback for weak references. This function was created with a
closure.  Modify the implementation to avoid the closure.

(cherry picked from commit a2af05a0d3)
2019-09-10 00:31:20 +02:00
Zachary Ware 12228ce41d
[3.7] bpo-34293: Fix PDF documentation paper size (GH-8585) (GH-15817)
The "A4" pdfs were previously the wrong size due to a change in the options in Sphinx 1.5.

See also sphinx-doc/sphinxGH-5235.
(cherry picked from commit b5381f6697)

Authored-by: Jean-François B <jfbu@free.fr>
2019-09-09 23:11:34 +01:00
Miss Islington (bot) b4591ad33a
bpo-35803: Document and test dir=PathLike for tempfile (GH-11644)
Co-Authored-By: Ammar Askar <ammar_askar@hotmail.com>
(cherry picked from commit 370138ba9c)

Co-authored-by: Anthony Sottile <asottile@umich.edu>
2019-09-09 10:33:18 -07:00
Miss Islington (bot) b7bf632d4e
bpo-38059: Using sys.exit() over exit() in inspect.py (GH-15666)
Constants added by the site module like exit() "should not be used in programs"
(cherry picked from commit e3c59a7527)

Co-authored-by: Alan Yee <alanyee@users.noreply.github.com>
2019-09-09 08:19:13 -07:00
Miss Islington (bot) 472f37ab9a
bpo-37702: Fix SSL's certificate-store leak on Windows (GH-15632)
ssl_collect_certificates function in _ssl.c has a memory leak.
Calling CertOpenStore() and CertAddStoreToCollection(), a store's refcnt gets incremented by 2.
But CertCloseStore() is called only once and the refcnt leaves 1.
(cherry picked from commit ed70129e15)

Co-authored-by: neonene <53406459+neonene@users.noreply.github.com>
2019-09-09 06:40:42 -07:00
Miss Islington (bot) d3b8a6bf7c
bpo-37283: Ensure command-line and unattend.xml setting override previously detected states in Windows installer (GH-15759)
(cherry picked from commit 3a0ddbcdfc)

Co-authored-by: Steve Dower <steve.dower@python.org>
2019-09-09 06:15:27 -07:00
Miss Islington (bot) 9ae9ac1061 bpo-37936: Avoid ignoring files that we actually do track. (GH-15451) (GH-15748)
There were about 14 files that are actually in the repo but that are
covered by the rules in .gitignore.

Git itself takes no notice of what .gitignore says about files that
it's already tracking... but the discrepancy can be confusing to a
human that adds a new file unexpectedly covered by these rules, as
well as to non-Git software that looks at .gitignore but doesn't
implement this wrinkle in its semantics.  (E.g., `rg`.)

Several of these are from rules that apply more broadly than
intended: for example, `Makefile` applies to `Doc/Makefile` and
`Tools/freeze/test/Makefile`, whereas `/Makefile` means only the
`Makefile` at the repo's root.

https://bugs.python.org/issue37936
(cherry picked from commit 5e5e951502)

Authored-by: Greg Price <gnprice@gmail.com>
2019-09-09 08:10:19 -05:00
Miss Islington (bot) c257591878
bpo-37705: Improve the implementation of winerror_to_errno() (GH-15623)
winerror_to_errno() is no longer automatically generated.
Do not rely on the old _dosmapperr() function.
Add ERROR_NO_UNICODE_TRANSLATION (1113) -> EILSEQ.
(cherry picked from commit 19052a1131)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2019-09-09 03:39:19 -07:00
Miss Islington (bot) bbf02da42e
bpo-32587: Make winreg.REG_MULTI_SZ support zero-length strings (GH-13239)
* bpo-32587: Make winreg.REG_MULTI_SZ support PendingFileRenameOperations

* Address review comments.
(cherry picked from commit e223ba13d8)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2019-09-09 03:04:54 -07:00
Miss Islington (bot) 1af2c0ec2f
bpo-37445: Include FORMAT_MESSAGE_IGNORE_INSERTS in FormatMessageW() calls (GH-14462)
If FormatMessageW() is passed the FORMAT_MESSAGE_FROM_SYSTEM flag without FORMAT_MESSAGE_IGNORE_INSERTS, it will fail if there are insert sequences in the message definition.
(cherry picked from commit a6563650c8)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2019-09-09 02:56:03 -07:00
Miss Islington (bot) 5190b7193c
bpo-34410: Fix a crash in the tee iterator when re-enter it. (GH-15625)
RuntimeError is now raised in this case.
(cherry picked from commit 526a01467b)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2019-09-09 02:11:22 -07:00
Miss Islington (bot) 021e5db20b
bpo-36946:Fix possible signed integer overflow when handling slices. (GH-15639)
This is a complement to PR 13375.
(cherry picked from commit 3c87a667bb)

Co-authored-by: HongWeipeng <hongweichen8888@sina.com>
2019-09-08 03:36:38 -07:00
Miss Islington (bot) 084ba337a9
bpo-38041: Refine IDLE Shell restart lines. (GH-15709)
Restart lines now always start with '=' and never end with ' ' and fill the width of the window unless that would require ending with ' ', which could be wrapped by itself and possible confusing the user.
(cherry picked from commit 38da805d56)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2019-09-06 11:19:30 -07:00
Miss Islington (bot) 1e2707d7e8 bpo-37380: subprocess: don't use _active on win (GH-14360) (GH-15706)
As noted by @eryksun in [1] and [2], using _cleanup and _active(in
__del__) is not necessary on Windows, since:

> Unlike Unix, a process in Windows doesn't have to be waited on by
> its parent to avoid a zombie. Keeping the handle open will actually
> create a zombie until the next _cleanup() call, which may be never
> if Popen() isn't called again.

This patch simply defines `subprocess._active` as `None`, for which we already
have the proper logic in place in `subprocess.Popen.__del__`, that prevents it
from trying to append the process to the `_active`. This patch also defines
`subprocess._cleanup` as a noop for Windows.

[1] https://bugs.python.org/issue37380GH-msg346333
[2] https://bugs.python.org/issue36067GH-msg336262

Signed-off-by: Ruslan Kuprieiev <ruslan@iterative.ai>
(cherry picked from commit 042821ae3c)

Co-authored-by: Ruslan Kuprieiev <kupruser@gmail.com>
2019-09-06 11:14:24 +02:00
Miss Islington (bot) 16af39aa84
bpo-37902: IDLE: Add scrolling for IDLE browsers. (GH-15368)
Modify the wheel event handler so it can also be used for module, path, and stack browsers.
Patch by George Zhang.
(cherry picked from commit 2cd9025858)

Co-authored-by: GeeTransit <geetransit@gmail.com>
2019-09-04 18:58:22 -07:00
Dong-hee Na 8873bff287 [3.7] bpo-22347: Update mimetypes.guess_type to allow proper parsing of URLs (GH-15522) (GH-15687)
https://bugs.python.org/issue22347
(cherry picked from commit 87bd2071c7)


https://bugs.python.org/issue22347



Automerge-Triggered-By: @maxking
2019-09-04 18:16:39 -07:00
Ashwin Ramaswami ea21389dda [3.7] bpo-37764: Fix infinite loop when parsing unstructured email headers. (GH-15239) (GH-15654)
…aders. (GH-15239)

Fixes a case in which email._header_value_parser.get_unstructured hangs the system for some invalid headers. This covers the cases in which the header contains either:
- a case without trailing whitespace
- an invalid encoded word

https://bugs.python.org/issue37764

This fix should also be backported to 3.7 and 3.8

https://bugs.python.org/issue37764
(cherry picked from commit c5b242f87f)

Co-authored-by: Ashwin Ramaswami <aramaswamis@gmail.com>





https://bugs.python.org/issue37764
2019-09-03 09:42:53 -07:00
Miss Islington (bot) 48058050ce
bpo-35771: IDLE: Fix flaky tool-tip hover delay tests (GH-15634)
Extending the hover delay in test_tooltip should avoid spurious test_idle failures.
One longer delay instead of two shorter delays results in a net speedup.
(cherry picked from commit 132acaba5a)

Co-authored-by: Tal Einat <taleinat+github@gmail.com>
2019-09-02 22:35:19 -07:00
Miss Islington (bot) 8ba8cc51a9
bpo-37979: Add alternative to fromisoformat in documentation (GH-15596)
Adds a link to `dateutil.parser.isoparse` in the documentation.

It would be nice to set up intersphinx for things like this, but I think we can leave that for a separate PR.

CC: @pitrou

[bpo-37979](https://bugs.python.org/issue37979)

https://bugs.python.org/issue37979

Automerge-Triggered-By: @pitrou
(cherry picked from commit 59725f3bad)

Co-authored-by: Paul Ganssle <paul@ganssle.io>
2019-08-29 07:54:04 -07:00
Miss Islington (bot) 6b50c10f67
bpo-37372: Fix error unpickling datetime.time objects from Python 2 with seconds>=24. (GH-14307)
(cherry picked from commit 122376df55)

Co-authored-by: Justin Blanchard <UncombedCoconut@gmail.com>
2019-08-29 00:57:41 -07:00
Miss Islington (bot) d3d2650cf8
bpo-37950: Fix ast.dump() when call with incompletely initialized node. (GH-15510)
(cherry picked from commit e64f948e76)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2019-08-29 00:04:44 -07:00
Miss Islington (bot) be310e03d0 bpo-36871: Ensure method signature is used when asserting mock calls to a method (GH15577)
* Fix call_matcher for mock when using methods

* Add NEWS entry

* Use None check and convert doctest to unittest

* Use better name for mock in tests. Handle _SpecState when the attribute was not accessed and add tests.

* Use reset_mock instead of reinitialization. Change inner class constructor signature for check

* Reword comment regarding call object lookup logic
(cherry picked from commit c96127821e)

Co-authored-by: Xtreak <tir.karthi@gmail.com>
2019-08-29 07:57:37 +01:00
Miss Islington (bot) 554143ebc2
bpo-18378: Recognize "UTF-8" as a valid name in locale._parse_localename (GH-14736)
(cherry picked from commit b0caf32981)

Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
2019-08-28 21:52:43 -07:00
Miss Islington (bot) ea48966e5d
closes bpo-37965: Fix compiler warning of distutils CCompiler.test_function. (GH-15560)
https://bugs.python.org/issue37965

https://bugs.python.org/issue37965

Automerge-Triggered-By: @benjaminp
(cherry picked from commit 55aabee075)

Co-authored-by: Anonymous Maarten <madebr@users.noreply.github.com>
2019-08-28 10:37:38 -07:00
Miss Islington (bot) 1bf672f53a
bpo-36205: Fix the rusage implementation of time.process_time() (GH-15538)
(cherry picked from commit 8bf5fef873)

Co-authored-by: vrajivk <3413293+vrajivk@users.noreply.github.com>
2019-08-26 21:31:27 -07:00
Steve Dower c1c1a33963 [3.7] bpo-37664: Update ensurepip bundled wheels, again (GH-15483) (GH-15529)
https://bugs.python.org/issue37664



Automerge-Triggered-By: @zooba
2019-08-26 12:19:53 -07:00
Miss Islington (bot) a976283821
bpo-37805: Add tests for json.dump(..., skipkeys=True) (GH-15489)
https://bugs.python.org/issue37805

Automerge-Triggered-By: @methane
(cherry picked from commit 44cd86bbdd)

Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
2019-08-26 00:36:36 -07:00
Miss Islington (bot) 1b15914ebb
bpo-37824: Properly handle user input warnings in IDLE shell. (GH-15500)
Cease turning SyntaxWarnings into SyntaxErrors.
(cherry picked from commit 1039f39c9c)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2019-08-25 23:53:38 -07:00
Miss Islington (bot) 31ea447ffe bpo-29553: Fix ArgumentParser.format_usage() for mutually exclusive groups (GH-14976)
Co-authored-by: Andrew Nester <andrew.nester.dev@gmail.com>
Co-authored-by: Flavian Hautbois <flavianh@sicara.com>

(cherry picked from commit da27d9b9dc)
2019-08-26 00:30:49 +03:00
Miss Islington (bot) f2b468dd6d
bpo-37929: IDLE: avoid Squeezer-related config dialog crashes (GH-15452)
These were caused by keeping around a reference to the Squeezer
instance and calling it's load_font() upon config changes, which
sometimes happened even if the shell window no longer existed.

This change completely removes that mechanism, instead having the
editor window properly update its width attribute, which can then
be used by Squeezer.
(cherry picked from commit d4b4c00b57)

Co-authored-by: Tal Einat <taleinat+github@gmail.com>
2019-08-24 23:17:19 -07:00
Miss Islington (bot) e6802d8a2e
Fix typo and rearrange words in IDLE news item (GH-15471)
Redo of GH-15402 by GeeTransit and Kyle Stanley.
(cherry picked from commit 0dfc025ccc)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2019-08-24 14:44:22 -07:00
GeeTransit 799e4e5270 [3.7] bpo-37461: Fix typo (inifite -> infinite) (GH-15430) 2019-08-24 00:30:25 -04:00
Miss Islington (bot) f8dc3e85ab
bpo-37549: os.dup() fails for standard streams on Windows 7 (GH-15389)
(cherry picked from commit 5be666010e)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2019-08-23 12:01:38 -07:00
Pablo Galindo 1b1796df3a
[3.7] bpo-37915: Fix comparison between tzinfo objects and timezone objects (GH-15390) (GH-15417)
https://bugs.python.org/issue37915

Automerge-Triggered-By: @pablogsal.
(cherry picked from commit 4be11c009a)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2019-08-23 11:12:31 +01:00
Miss Islington (bot) 735a960ac9
bpo-36311: Fixes decoding multibyte characters around chunk boundaries and improves decoding performance (GH-15083)
(cherry picked from commit 7ebdda0dbe)

Co-authored-by: Steve Dower <steve.dower@python.org>
2019-08-21 16:55:57 -07:00
Miss Islington (bot) c5bba853d5
bpo-37482: Fix email address name with encoded words and special chars (GH-14561)
Special characters in email address header display names are normally
put within double quotes. However, encoded words (=?charset?x?...?=) are
not allowed withing double quotes. When the header contains a word with
special characters and another word that must be encoded, the first one
must also be encoded.

In the next example, the display name in the From header is quoted and
therefore the comma is allowed; in the To header, the comma is not
within quotes and not encoded, which is not allowed and therefore
rejected by some mail servers.

From: "Foo Bar, France" <foo@example.com>
To: Foo Bar, =?utf-8?q?Espa=C3=B1a?= <foo@example.com>

https://bugs.python.org/issue37482
(cherry picked from commit df0c21ff46)

Co-authored-by: bsiem <52461103+bsiem@users.noreply.github.com>
2019-08-21 16:21:48 -07:00
Miss Islington (bot) 02c1457a03
bpo-37868: Improve is_dataclass for instances. (GH-15325)
(cherry picked from commit b0f4dab873)

Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
2019-08-19 23:01:55 -07:00
Paul Ganssle ed44b84961
bpo-37642: Update acceptable offsets in timezone (GH-14878) (#15226)
This fixes an inconsistency between the Python and C implementations of
the datetime module. The pure python version of the code was not
accepting offsets greater than 23:59 but less than 24:00. This is an
accidental legacy of the original implementation, which was put in place
before tzinfo allowed sub-minute time zone offsets.

GH-14878

(cherry picked from commit 92c7e30adf)
2019-08-15 15:09:37 -04:00
Miss Islington (bot) 1581d9c405
bpo-21131: Fix faulthandler.register(chain=True) stack (GH-15276)
faulthandler now allocates a dedicated stack of SIGSTKSZ*2 bytes,
instead of just SIGSTKSZ bytes. Calling the previous signal handler
in faulthandler signal handler uses more than SIGSTKSZ bytes of stack
memory on some platforms.
(cherry picked from commit ac827edc49)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2019-08-14 15:09:39 -07:00
Miss Islington (bot) b0b178a2b8
bpo-37811: FreeBSD, OSX: fix poll(2) usage in sockets module (GH-15202)
FreeBSD implementation of poll(2) restricts the timeout argument to be
either zero, or positive, or equal to INFTIM (-1).

Unless otherwise overridden, socket timeout defaults to -1. This value
is then converted to milliseconds (-1000) and used as argument to the
poll syscall. poll returns EINVAL (22), and the connection fails.

This bug was discovered during the EINTR handling testing, and the
reproduction code can be found in
https://bugs.python.org/issue23618 (see connect_eintr.py,
attached). On GNU/Linux, the example runs as expected.

This change is trivial:
If the supplied timeout value is negative, truncate it to -1.
(cherry picked from commit 2814620657)

Co-authored-by: Artem Khramov <akhramov@pm.me>
2019-08-14 14:48:03 -07:00
Miss Islington (bot) 88cce7b59f
bpo-37849: IDLE: fix completion window positioning above line (GH-15267)
(cherry picked from commit 71662dc2f1)

Co-authored-by: Tal Einat <taleinat+github@gmail.com>
2019-08-14 10:37:49 -07:00
Victor Stinner 93bee6a8d8
[3.7] bpo-37531: Fix regrtest timeout for subprocesses (GH-15072) (GH-15280)
Co-Authored-By: Joannah Nanjekye <joannah.nanjekye@ibm.com>
(cherry picked from commit b0c8369c60)

Backport also minor win_utils.py fixes from master.
2019-08-14 16:30:54 +02:00
Miss Islington (bot) 3e1f135b26
bpo-37256: Wording in Request class docs (GH-14792)
* bpo-37256: Wording in Request class docs

* 📜🤖 Added by blurb_it.

* Update Misc/NEWS.d/next/Documentation/2019-07-16-14-48-12.bpo-37256.qJTrBb.rst

Co-Authored-By: Kyle Stanley <aeros167@gmail.com>
(cherry picked from commit 38c7199beb)

Co-authored-by: Ngalim Siregar <ngalim.siregar@gmail.com>
2019-08-14 06:55:53 -07:00
Victor Stinner 7eef81ee76
bpo-37738: Fix curses addch(str, color_pair) (GH-15071) (GH-15273)
Fix the implementation of curses addch(str, color_pair): pass the
color pair to setcchar(), instead of always passing 0 as the color
pair.

(cherry picked from commit 077af8c2c9)
2019-08-14 13:00:27 +02:00
Miss Islington (bot) dec231a73c
bpo-32178: Fix IndexError trying to parse 'To' header starting with ':'. (GH-15044)
This should fix the IndexError trying to retrieve `DisplayName.display_name` and `DisplayName.value` when the `value` is basically an empty string.

https://bugs.python.org/issue32178
(cherry picked from commit 09a1872a80)

Co-authored-by: Abhilash Raj <maxking@users.noreply.github.com>
2019-08-11 14:05:37 -07:00
Miss Islington (bot) c48d606adc
bpo-34155: Dont parse domains containing @ (GH-13079)
Before:

        >>> email.message_from_string('From: a@malicious.org@important.com', policy=email.policy.default)['from'].addresses
        (Address(display_name='', username='a', domain='malicious.org'),)

        >>> parseaddr('a@malicious.org@important.com')
        ('', 'a@malicious.org')

    After:

        >>> email.message_from_string('From: a@malicious.org@important.com', policy=email.policy.default)['from'].addresses
        (Address(display_name='', username='', domain=''),)

        >>> parseaddr('a@malicious.org@important.com')
        ('', 'a@')

https://bugs.python.org/issue34155
(cherry picked from commit 8cb65d1381)

Co-authored-by: jpic <jpic@users.noreply.github.com>
2019-08-09 01:30:33 -07:00
Miss Islington (bot) 7dafbe81bd bpo-37004: Documented asymmetry of string arguments in difflib.SequenceMatcher for ratio method (GH-13482) (#15158)
https://bugs.python.org/issue37004
(cherry picked from commit e9cbcd0018)

Co-authored-by: sweeneyde <36520290+sweeneyde@users.noreply.github.com>
2019-08-07 11:39:47 -04:00
Miss Islington (bot) 4969192f99
bpo-36419: IDLE - Refactor autocompete and improve testing. (GH-15121)
(cherry picked from commit 1213123005)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2019-08-04 17:09:36 -07:00
Miss Islington (bot) a96f0367d4
bpo-37748: Re-order the Run menu. (GH-15115)
Put the most common choice, Run Module, at the top.
(cherry picked from commit 14070299cd)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2019-08-04 14:07:26 -07:00
Tal Einat a2ea9448c6
[3.7] bpo-34621: backwards-compatible pickle UUID with is_safe=unknown (GH-14834)
This is a fix for a bug introduced in the original implementation of this for 3.7.
2019-08-04 22:26:32 +03:00
Serhiy Storchaka 6ed20e54e4
[3.7] bpo-37685: Fixed comparisons of datetime.timedelta and datetime.timezone. (GH-14996) (GH-15104)
There was a discrepancy between the Python and C implementations.

Add singletons ALWAYS_EQ, LARGEST and SMALLEST in test.support
to test mixed type comparison.
(cherry picked from commit 17e52649c0)
2019-08-04 15:28:21 +03:00
Miss Islington (bot) 1ff7dd681c
bpo-20523: pdb searches for .pdbrc in ~ instead of $HOME (GH-11847)
Previously pdb checked the $HOME environmental variable
to find the user .pdbrc. If $HOME is not set, the user
.pdbrc would not be found.

Change pdb to use `os.path.expanduser('~')` to determine
the user's home directory. Thus, if $HOME is not set (as
in tox or on Windows), os.path.expanduser('~') falls
back on other techniques for locating the user's home
directory.

This follows pip's implementation for loading .piprc.

Co-authored-by: Dan Lidral-Porter <dlp@aperiodic.org>
(cherry picked from commit 7ea9a85f13)

Co-authored-by: Timothy Hopper <tdhopper@users.noreply.github.com>
2019-08-02 15:40:14 -07:00
Miss Islington (bot) 8990ac0ab0 bpo-37726: Prefer argparse over getopt in stdlib tutorial (GH-15052) (#15069)
(cherry picked from commit 2491134029)

Co-authored-by: mental <m3nta1@yahoo.com>
2019-08-01 07:35:20 -07:00
Miss Islington (bot) 35d9c37e27
bpo-37695: Correct unget_wch error message. (GH-14986)
(cherry picked from commit c9345e382c)

Co-authored-by: Anthony Sottile <asottile@umich.edu>
2019-07-31 13:25:45 -07:00
Miss Islington (bot) 33b700ba8c
bpo-37723: Fix performance regression on regular expression parsing. (GH-15030)
Improve performance of sre_parse._uniq function.
(cherry picked from commit 9f55551f3d)

Co-authored-by: yannvgn <hi@yannvgn.io>
2019-07-31 13:22:19 -07:00
Miss Islington (bot) d30626443d
bpo-37692: Improve highlight config sample (GH-14983)
Use an example shell interaction in the sample and better labels for shell elements.
(cherry picked from commit b222955355)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2019-07-28 09:22:18 -07:00
Miss Islington (bot) 0242eb3fa7
bpo-37628: Fix IDLE config sample sizes (GH-14958)
The boxes for the font and highlight samples are now constrained by the overall config dialog size.  They gain scrollbars when the when a large font size makes the samples too large for the box.
(cherry picked from commit 3221a63c69)

Co-authored-by: Tal Einat <taleinat+github@gmail.com>
2019-07-27 10:14:54 -07:00
Miss Islington (bot) 4b6421c61e
bpo-32910: Remove implementation detail in venv documentation. (GH-14968)
(cherry picked from commit 91e4957509)

Co-authored-by: Derek Keeler <d3r3kk@users.noreply.github.com>
2019-07-26 15:03:23 -07:00
Miss Islington (bot) ea0f7aa47c
bpo-37664: Update bundled pip to 19.2.1 and setuptools to 41.0.1 (GH-14934)
(cherry picked from commit 5380def826)

Co-authored-by: Pradyun Gedam <pradyunsg@gmail.com>
2019-07-26 10:19:15 -07:00
Miss Islington (bot) 9194a20a5b
closes bpo-37675: Use pkgutil.iter_modules to find fixers in a package rather than listdir. (14942)
(cherry picked from commit 93e8aa62cf)

Co-authored-by: Benjamin Peterson <benjamin@python.org>
2019-07-24 16:57:39 -07:00
Tal Einat e9ec1663d8
[3.7] bpo-17535: IDLE editor line numbers (GH-14030)
(cherry picked from commit 7123ea009b)
2019-07-23 16:27:04 +03:00
Kyle Stanley 83cec020ba [3.7] Fix typos in docs, comments and test assert messages (GH-14872). (#14901)
(cherry picked from commit 96e12d5f4f)

Co-authored-by: Min ho Kim <minho42@gmail.com>
2019-07-22 14:14:07 -04:00
Miss Islington (bot) e9b187a2bf bpo-21478: Record calls to parent when autospecced objects are used as child with attach_mock (GH 14688) (GH-14903)
* Clear name and parent of mock in autospecced objects used with attach_mock

* Add NEWS entry

* Fix reversed order of comparison

* Test child and standalone function calls

* Use a helper function extracting mock to avoid code duplication and refactor tests.
(cherry picked from commit 7397cda997)

Co-authored-by: Xtreak <tir.karthi@gmail.com>
2019-07-22 09:04:07 +01:00
Miss Islington (bot) 849a37a2b6
bpo-37627: Add acknowledgment (GH-14883)
(cherry picked from commit 4214f1ec3b)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2019-07-21 13:38:01 -07:00
Miss Islington (bot) d9086f2324
bpo-37627: Initialize IDLE Custom Run dialog with previous entries (GH-14870)
Repeat the command line arguments most recently entered before so the user can edit them.
(cherry picked from commit 35b87e6001)

Co-authored-by: Ngalim Siregar <ngalim.siregar@gmail.com>
2019-07-21 09:09:17 -07:00
Miss Islington (bot) db2957c8eb
bpo-33610: IDLE's code-context always shows current context immediately (GH-14821)
Eliminate delay of up to 100ms and accompanying visual artifact.
Fix bug of never showing context when hide and show.
(cherry picked from commit e0a1f8fb5c)

Co-authored-by: Tal Einat <taleinat@gmail.com>
2019-07-18 13:46:34 -07:00
Miss Islington (bot) 5eb19fddd2 bpo-36390: Gather IDLE Format menu functions into format.py (GH-14827) (GH-14830)
Add two indent spec methods from editor and Rstrip to existing file.
Tests are not added for indent methods because they need change
in lights of 3.x's prohibition on mixing tabs and spaces.
(cherry picked from commit 1b38922434)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2019-07-17 21:22:25 -04:00
Miss Islington (bot) 80f74ce83b
Fix IndexError when parsing unexpectedly ending quoted-string. (GH-14813)
This exception was caused because the input ended unexpectedly with only one
single quote instead of a pair with some value inside it.
(cherry picked from commit 719a062bcb)

Co-authored-by: Abhilash Raj <maxking@users.noreply.github.com>
2019-07-17 10:32:31 -07:00
Miss Islington (bot) 391511ccaa
bpo-37461: Fix infinite loop in parsing of specially crafted email headers (GH-14794)
* bpo-37461: Fix infinite loop in parsing of specially crafted email headers.

Some crafted email header would cause the get_parameter method to run in an
infinite loop causing a DoS attack surface when parsing those headers. This
patch fixes that by making sure the DQUOTE character is handled to prevent
going into an infinite loop.
(cherry picked from commit a4a994bd3e)

Co-authored-by: Abhilash Raj <maxking@users.noreply.github.com>
2019-07-17 10:02:05 -07:00
Miss Islington (bot) 093e9b1268 bpo-36390: IDLE: Combine region formatting methods. (GH-12481) (GH-14812)
Rename paragraph.py to format.py and add region formatting methods
from editor.py.  Add tests for the latter.
(cherry picked from commit 82494aa6d9)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
2019-07-17 10:46:14 -04:00
Miss Islington (bot) bb79ab84c2
bpo-37530: simplify, optimize and clean up IDLE code context (GH-14675)
* Only create CodeContext instances for "real" editors windows, but
  not e.g. shell or output windows.
* Remove configuration update Tk event fired every second, by having
  the editor window ask its code context widget to update when
  necessary, i.e. upon font or highlighting updates.
* When code context isn't being shown, avoid having a Tk event fired
  every 100ms to check whether the code context needs to be updated.
* Use the editor window's getlineno() method where applicable.
* Update font of the code context widget before the main text widget
(cherry picked from commit 7036e1de3a)

Co-authored-by: Tal Einat <taleinat@gmail.com>
2019-07-17 01:44:18 -07:00
Miss Islington (bot) efd23a199b bpo-27452: IDLE: Cleanup config.py code (GH-14577) (GH-14803)
(cherry picked from commit f8d4cc7dbb)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
2019-07-16 17:31:47 -04:00
Miss Islington (bot) e7bec26937
Fix infinite loop in email folding logic (GH-12732)
As far as I can tell, this infinite loop would be triggered if:

1. The value being folded contains a single word (no spaces) longer than
   max_line_length
2. The max_line_length is shorter than the encoding's name + 9
   characters.

bpo-36564: https://bugs.python.org/issue36564
(cherry picked from commit f69d5c6198)

Co-authored-by: Paul Ganssle <pganssle@users.noreply.github.com>
2019-07-16 11:15:40 -07:00
Miss Islington (bot) 134f79682d
bpo-37284: Add note to sys.implementation doc (GH-14328)
Add a brief note to indicate that any new required attributes must go through the PEP process.

https://bugs.python.org/issue37284
(cherry picked from commit 52693c10e8)

Co-authored-by: Giovanni Cappellotto <gcappellotto@fb.com>
2019-07-15 07:44:26 -07:00
Xtreak c6b3106199 [3.7] bpo-37579: Improve equality behavior for pure Python datetime and time (GH-14726) (GH-14745)
Returns NotImplemented for timedelta and time in __eq__ for different types in Python implementation, which matches the C implementation.

This also adds tests to enforce that these objects will fall back to the right hand side's __eq__ and/or __ne__ implementation.

[bpo-37579](https://bugs.python.org/issue37579)
(cherry picked from commit e6b46aafad)

Co-authored-by: Xtreak <tir.karthi@gmail.com>





https://bugs.python.org/issue37579
2019-07-14 03:13:59 -07:00
Miss Islington (bot) d1524148cd
bpo-30088: Document that existing dir structure isn't verified by mailbox.Maildir (GH-1163)
Hi,

I've faced an issue w/ `mailbox.Maildir()`. The case is following:
1. I create a folder with `tempfile.TemporaryDirectory()`, so it's empty
2. I pass that folder path as an argument when instantiating `mailbox.Maildir()`
3. Then I receive an exception happening because "there's no such file or directory" (namely `cur`, `tmp` or `new`) during interaction with Maildir

**Expected result:** subdirs are created during `Maildir()` instance creation.

**Actual result:** subdirs are assumed as existing which leads to exceptions during use.

**Workaround:** remove the actual dir before passing the path to `Maildir()`. It will be created automatically with all subdirs needed.

**Fix:** This PR. Basically it adds creation of subdirs regardless of whether the base dir existed before.

https://bugs.python.org/issue30088
(cherry picked from commit e44184749c)

Co-authored-by: Sviatoslav Sydorenko <wk@sydorenko.org.ua>
2019-07-13 07:59:32 -07:00
Ned Deily d9012d6f23 Python 3.7.4
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEDZbfTUEQ5cQ/v7F/LTR+pqplQh0FAl0jhbcACgkQLTR+pqpl
 Qh0L/RAA0VudQZoa1URDmigDGODWg+LZ7Qf9Po5/9y2Zp3dytbxrt40zzo/Wonhi
 jbwbpo6umkpL0TlziN2biKSjbPzzvAlk0+Y+Iw3tXDGByqZ25GD4G3AE4nS/xbou
 oDmH6uLqgbvPRwFJYrFG3avplVpIj38MkScdbUQ+2pLPulcBnw52eFmzav2JuT8W
 WDNeLIRn8kCbjL7T+nLIU0YdE39E3OE3KMVWFZwNmkutNIm3YT0k+eMafbvOGKJQ
 iTZZ3d6miGqSILqQLiJjUzUneJemlvGJmOrtpJlhZiUjb8202MlhKDW2Bk6MWSKV
 DqTXapMw1lGCVd7zELMIK01pjpW0nqzo44tSzlqSMHoBrHDP7QNnhCin+jmHP/er
 h0J/K9+zkDCWc45a/KymDn2PpXeTwY2aIUcvW/2mQX6EeEm6dwq2Vvz8mjflRyYz
 Wd89Yi475bZfZQ4bxce1sFQ6a6b0jOShl21kbehCWtslvqc/5Y94brIinU7OTF1N
 xeHMPoM2mHprT/ftxmbgrrlISP7usYSgmDa/MuBOgH6cPxsZq+J9HkDtONgFe5UE
 OXV6ucQ4c+5uOCBHVdbC6iPFdJvJJ4Ok5LFQ9CjL3y61H+WT1mkqSZeFyqWHurJB
 ip8mScWh24FCQDH0PLMmDoS1BLUqq0ROFynXDb3Rycp1jz/fYqQ=
 =Hhx/
 -----END PGP SIGNATURE-----

Merge release engineering branch
2019-07-08 17:51:58 -04:00
Ned Deily e09359112e 3.7.4 final 2019-07-08 14:03:50 -04:00
Miss Islington (bot) f2cbf41afc bpo-37149: Replace dead link for online Tkinter reference (GH-14616)
Also fix a name misspelling.
(cherry picked from commit 45bc61b971)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2019-07-08 12:43:43 -04:00
Ned Deily 87a918a003 [3.7] bpo-37500: update Misc/NEWS entries to mention revert 2019-07-08 12:39:12 -04:00
Miss Islington (bot) 1dd6507595 bpo-37478: Specify possible exceptions for os.chdir() (GH-14611) (GH-14630)
(cherry picked from commit 0717b4d9b3)

Co-authored-by: Kyle Stanley <aeros167@gmail.com>
2019-07-06 22:19:08 -04:00
Miss Islington (bot) 9c930d076a bpo-37487: Fix PyList_GetItem index description. (GH-14623) (GH-14625)
0 is a legal index.
(cherry picked from commit f8709e804d)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2019-07-06 17:55:19 -04:00
Miss Islington (bot) d666217b26
bpo-26806: add 30 to the recursion limit in IDLE's shell (GH-13944)
This is done to compensate for the extra stack frames added by
IDLE itself, which cause problems when setting the recursion limit
to low values.

This wraps sys.setrecursionlimit() and sys.getrecursionlimit()
as invisibly as possible.
(cherry picked from commit fcf1d003bf)

Co-authored-by: Tal Einat <taleinat+github@gmail.com>
2019-07-06 05:56:10 -07:00
Miss Islington (bot) d2c5677a4f
bpo-37149: Replace dead link for online Tkinter reference (GH-14616)
Also fix a name misspelling.
(cherry picked from commit 45bc61b971)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2019-07-05 23:37:38 -07:00
Miss Islington (bot) 2d438fc0b7
bpo-37421: Fix multiprocessing get_temp_dir() finalizer (GH-14572)
Fix multiprocessing.util.get_temp_dir() finalizer: clear also the
'tempdir' configuration of the current process, so next call to
get_temp_dir() will create a new temporary directory, rather than
reusing the removed temporary directory.
(cherry picked from commit 9d40554e0d)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2019-07-04 03:45:58 -07:00
Ned Deily a56138f147 Python 3.7.4rc2
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEDZbfTUEQ5cQ/v7F/LTR+pqplQh0FAl0bp8oACgkQLTR+pqpl
 Qh1VRw/8C5fGRJAWG0yiG4Kvi/kZMBefuSfDuQrIoIPze/T58lC3cVIuyUwNW+Re
 /IqvP9A+olcxQwfdpqm0fOIrDF4WlaexPdCzcDhN5heH1nsHrj+gEzL+B+TDyGNu
 TnOrlY851PbjawxRljVKUgGT7S+QQauDThnMIC5/QN16ItwT1pYKvgMvPNIreJlR
 CMGb55HHtHMMMUtFy6SV4T4Md4n5F2waeO5hbB5Ge7ZeNFrHwkKR5Vql4EwHrLR+
 Mspa1plw2FJN1PktN/aiHey0oH552JiH5TXxVG4CcopEO5R1+92XovEzEnYszI2P
 kJ/GejT+790V6qqImg/tOJATJ3uWl4ABLZAHLun9HVb2ICNxa/jk0TO6Zwh0wmE+
 QbbqVpQG2ltAfoeZ0cWpXUlytVFQFZKR/Yym0lS3NlT3p86lrI9ieOrEjunmjQv7
 uu1z6NB/VlfzoZKfd6A2IPqqrmu1bN1Hmc8TwdRTIznuvwi0VS7Ts70tnPgRRzIw
 iM2FejSTYNBLnHoEDoQZ7IULYvD46utMQ3gfCzoZjc1nafcW6e15HstpTxX92hZx
 woq/OV1/KnZF/JiFBebDLMN6A38GJcqpb+WdB7XX1LpcHI3PxL+ktb34UWRdyHhE
 stJBm1XN3/CughzwordIcqWJsTl+8IsEKkeFFcF7QeXgpZKEpkI=
 =JIBM
 -----END PGP SIGNATURE-----

Merge tag 'v3.7.4rc2' into 3.7
2019-07-02 18:23:54 -04:00
Miss Islington (bot) 024ea2170b
bpo-37463: match_hostname requires quad-dotted IPv4 (GH-14499)
ssl.match_hostname() no longer accepts IPv4 addresses with additional text
after the address and only quad-dotted notation without trailing
whitespaces. Some inet_aton() implementations ignore whitespace and all data
after whitespace, e.g. '127.0.0.1 whatever'.

Short notations like '127.1' for '127.0.0.1' were already filtered out.

The bug was initially found by Dominik Czarnota and reported by Paul Kehrer.

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

https://bugs.python.org/issue37463
(cherry picked from commit 477b1b2576)

Co-authored-by: Christian Heimes <christian@python.org>
2019-07-02 14:22:53 -07:00
Ned Deily 7f193e8969 3.7.4rc2 2019-07-02 14:51:09 -04:00
Christian Heimes 070fae6d0f bpo-37463: match_hostname requires quad-dotted IPv4 (GH-14499)
ssl.match_hostname() no longer accepts IPv4 addresses with additional text
after the address and only quad-dotted notation without trailing
whitespaces. Some inet_aton() implementations ignore whitespace and all data
after whitespace, e.g. '127.0.0.1 whatever'.

Short notations like '127.1' for '127.0.0.1' were already filtered out.

The bug was initially found by Dominik Czarnota and reported by Paul Kehrer.

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



https://bugs.python.org/issue37463
2019-07-02 14:42:08 -04:00
Jakub Kulík c53173aa00 bpo-37335: Fix test_c_locale_coercion to handle any ASCII alias (GH-14449)
Fix unexpected ASCII aliases in locale coercion tests: normalize encoding
names with codecs.lookup(encoding).name.
2019-07-02 12:46:00 +02:00
Miss Islington (bot) dcc0eb3796 bpo-34602: Avoid failures setting macOS stack resource limit (GH-14546)
Under some conditions the earlier fix for bpo-18075, "Infinite recursion
tests triggering a segfault on Mac OS X", now causes failures on macOS
when attempting to change stack limit with resource.setrlimit
resource.RLIMIT_STACK, like regrtest does when running the test suite.
The reverted change had specified a non-default stack size when linking
the python executable on macOS.  As of macOS 10.14.4, the previous
code causes a hard failure when running tests, although similar
failures had been seen under some conditions under some earlier
systems.  Reverting the change to the interpreter stack size at link
time helped for release builds but caused some tests to fail when
built --with-pydebug.  Try the opposite approach: continue to build
the interpreter with an increased stack size on macOS and remove
the failing setrlimit call in regrtest initialization.  This will
definitely avoid the resource.RLIMIT_STACK error and should have
no, or fewer, side effects.
(cherry picked from commit 5bbbc733e6)

Co-authored-by: Ned Deily <nad@python.org>
2019-07-02 03:40:38 -04:00
Miss Islington (bot) bf82cd3124
bpo-34602: Avoid failures setting macOS stack resource limit (GH-14546)
Under some conditions the earlier fix for bpo-18075, "Infinite recursion
tests triggering a segfault on Mac OS X", now causes failures on macOS
when attempting to change stack limit with resource.setrlimit
resource.RLIMIT_STACK, like regrtest does when running the test suite.
The reverted change had specified a non-default stack size when linking
the python executable on macOS.  As of macOS 10.14.4, the previous
code causes a hard failure when running tests, although similar
failures had been seen under some conditions under some earlier
systems.  Reverting the change to the interpreter stack size at link
time helped for release builds but caused some tests to fail when
built --with-pydebug.  Try the opposite approach: continue to build
the interpreter with an increased stack size on macOS and remove
the failing setrlimit call in regrtest initialization.  This will
definitely avoid the resource.RLIMIT_STACK error and should have
no, or fewer, side effects.
(cherry picked from commit 5bbbc733e6)

Co-authored-by: Ned Deily <nad@python.org>
2019-07-02 00:38:36 -07:00
Miss Islington (bot) f97eb883d8 [3.7] bpo-37440: Enable TLS 1.3 post-handshake auth in http.client (GH-14448) (GH-14496)
Post-handshake authentication is required for conditional client cert authentication with TLS 1.3.


https://bugs.python.org/issue37440
(cherry picked from commit d1bd6e79da)


Co-authored-by: Christian Heimes <christian@python.org>


https://bugs.python.org/issue37440
2019-07-01 22:29:17 -04:00
Miss Islington (bot) 5b45fb0a44 [3.7] bpo-37428: Don't set PHA verify flag on client side (GH-14421) (GH-14493)
SSLContext.post_handshake_auth = True no longer sets
SSL_VERIFY_POST_HANDSHAKE verify flag for client connections. Although the
option is documented as ignored for clients, OpenSSL implicitly enables cert
chain validation when the flag is set.

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



https://bugs.python.org/issue37428
(cherry picked from commit f0f5930ac8)


Co-authored-by: Christian Heimes <christian@python.org>


https://bugs.python.org/issue37428
2019-07-01 22:27:58 -04:00
Steve Dower 3c34ea97a3 bpo-37369: Fixes path for sys.executable when running from the Microsoft Store (GH-14450) 2019-07-01 22:24:26 -04:00
Miss Islington (bot) cc0bf97d61 closes bpo-37437: Update vendorized expat to 2.2.7. (GH-14436)
(cherry picked from commit 3b03b09fc9)

Co-authored-by: Benjamin Peterson <benjamin@python.org>
2019-07-01 22:23:08 -04:00
Miss Islington (bot) 30c2ae4dcf [3.7] bpo-24214: Fixed the UTF-8 and UTF-16 incremental decoders. (GH-14304) (GH-14369)
* bpo-24214: Fixed the UTF-8 and UTF-16 incremental decoders. (GH-14304)

* The UTF-8 incremental decoders fails now fast if encounter
  a sequence that can't be handled by the error handler.
* The UTF-16 incremental decoders with the surrogatepass error
  handler decodes now a lone low surrogate with final=False.
(cherry picked from commit 894263ba80)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2019-07-01 22:21:22 -04:00
Miss Islington (bot) c58fc3af75 bpo-35360: Update Windows builds to use SQLite 3.28.0 (GH-14179)
(cherry picked from commit 7fd2ba354e)

Co-authored-by: animalize <animalize@users.noreply.github.com>
2019-07-01 22:20:35 -04:00
Miss Islington (bot) e90815b3b1 bpo-32627: Fix compile error when conflicting `_uuid` headers included (GH-11751)
(cherry picked from commit 6ffd9b05df)

Co-authored-by: ziheng <zihenglv@gmail.com>
2019-07-01 22:19:49 -04:00
Victor Stinner 8cbffc4d96
bpo-37467: Fix PyErr_Display() for bytes filename (GH-14504) (GH-14515)
Fix sys.excepthook() and PyErr_Display() if a filename is a bytes
string. For example, for a SyntaxError exception where the filename
attribute is a bytes string.

Cleanup also test_sys:

* Sort imports.
* Rename numruns global var to INTERN_NUMRUNS.
* Add DisplayHookTest and ExceptHookTest test case classes.
* Don't save/restore sys.stdout and sys.displayhook using
  setUp()/tearDown(): do it in each test method.
* Test error case (call hook with no argument) after the success case.

(cherry picked from commit f9b7457bd7)
2019-07-01 17:41:38 +02:00
Miss Islington (bot) 45c10da409
bpo-10945: Drop support for bdist_wininst on non-Windows systems (GH-14506)
bdist_wininst depends on MBCS codec, unavailable on non-Windows,
and bdist_wininst have not worked since at least Python 3.2, possibly
never on Python 3.

Here we document that bdist_wininst is only supported on Windows,
and we mark it unsupported otherwise to skip tests.

Distributors of Python 3 can now safely drop the bdist_wininst .exe files
without the need to skip bdist_wininst related tests.
(cherry picked from commit 72cd653c4e)

Co-authored-by: Miro Hrončok <miro@hroncok.cz>
2019-07-01 05:42:08 -07:00
Miss Islington (bot) 6be91102f7
[3.7] bpo-37440: Enable TLS 1.3 post-handshake auth in http.client (GH-14448) (GH-14496)
Post-handshake authentication is required for conditional client cert authentication with TLS 1.3.


https://bugs.python.org/issue37440
(cherry picked from commit d1bd6e79da)


Co-authored-by: Christian Heimes <christian@python.org>


https://bugs.python.org/issue37440
2019-07-01 00:07:52 -07:00
Miss Islington (bot) cf7617460a
[3.7] bpo-37428: Don't set PHA verify flag on client side (GH-14421) (GH-14493)
SSLContext.post_handshake_auth = True no longer sets
SSL_VERIFY_POST_HANDSHAKE verify flag for client connections. Although the
option is documented as ignored for clients, OpenSSL implicitly enables cert
chain validation when the flag is set.

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



https://bugs.python.org/issue37428
(cherry picked from commit f0f5930ac8)


Co-authored-by: Christian Heimes <christian@python.org>


https://bugs.python.org/issue37428
2019-06-30 23:51:40 -07:00
Steve Dower db4d7ddb01
bpo-37369: Fixes path for sys.executable when running from the Microsoft Store (GH-14450) 2019-06-28 10:02:13 -07:00
Miss Islington (bot) 87cc66877c
closes bpo-37437: Update vendorized expat to 2.2.7. (GH-14436)
(cherry picked from commit 3b03b09fc9)

Co-authored-by: Benjamin Peterson <benjamin@python.org>
2019-06-27 21:15:09 -07:00
Miss Islington (bot) 65e187239a
closes bpo-37420: Handle errors during iteration in os.sched_setaffinity. (GH-14414)
(cherry picked from commit 45a30af109)

Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
2019-06-27 09:30:41 -07:00
Miss Islington (bot) b950cdb4be bpo-29412: Fix indexError when parsing a header value ending unexpectedly (GH-14387) (GH-14412)
* patched string index out of range error in get_word function of _header_value_parser.py and created tests in test__header_value_parser.py for CFWS.
* Raise HeaderParseError instead of continuing when parsing a word.
(cherry picked from commit 7213df7bbf)

Co-authored-by: Abhilash Raj <maxking@users.noreply.github.com>
2019-06-26 15:05:04 -07:00
Serhiy Storchaka 6ef103fbdb
[3.7] bpo-37163: dataclasses.replace() now supports the field named "obj". (GH-13877) (GH-14405)
(cherry picked from commit f5b89af)
2019-06-26 23:03:08 +03:00
Miss Islington (bot) 814c7aefc2
bpo-37411: Rewrite test_wsgiref.testEnviron() (GH-14394)
Fix test_wsgiref.testEnviron() to no longer depend on the environment
variables (don't fail if "X" variable is set).

testEnviron() now overrides os.environ to get a deterministic
environment. Test full TestHandler.environ content: not only a few
selected variables.
(cherry picked from commit 5150d32792)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2019-06-26 12:37:57 -07:00
Miss Islington (bot) 7675bca4b5
bpo-37417: Fix error handling in bytearray.extend. (GH-14407)
(cherry picked from commit 2a7d596f27)

Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
2019-06-26 12:23:19 -07:00
Miss Islington (bot) 1d4b6ba194 bpo-37400: Fix test_os.test_chown() (GH-14374) (GH-14378)
Use os.getgroups() rather than grp.getgrall() to get groups.
Rename also the test to test_chown_gid().
(cherry picked from commit d7c87d982d)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2019-06-25 22:25:01 +02:00
Abhilash Raj 01b2394803 [3.7] bpo-33972: Fix EmailMessage.iter_attachments raising AttributeError. (GH-14119) (GH-14381)
When certain malformed messages have content-type set to 'mulitpart/*' but
still have a single part body, iter_attachments can raise AttributeError. This
patch fixes it by returning a None value instead when the body is single part.
(cherry picked from commit 02257012f6)

Co-authored-by: Abhilash Raj <maxking@users.noreply.github.com>



https://bugs.python.org/issue33972
2019-06-25 11:40:41 -07:00
Steve Dower 2a99fd911e
bpo-4963: Fix for initialization and non-deterministic behavior issues in mimetypes (GH-14376) 2019-06-25 09:12:14 -07:00
Miss Islington (bot) c755ca89c7 [3.7] bpo-24214: Fixed the UTF-8 and UTF-16 incremental decoders. (GH-14304) (GH-14369)
* bpo-24214: Fixed the UTF-8 and UTF-16 incremental decoders. (GH-14304)

* The UTF-8 incremental decoders fails now fast if encounter
  a sequence that can't be handled by the error handler.
* The UTF-16 incremental decoders with the surrogatepass error
  handler decodes now a lone low surrogate with final=False.
(cherry picked from commit 894263ba80)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2019-06-25 12:29:18 +02:00
Miss Islington (bot) 14c179f97d
bpo-35360: Update Windows builds to use SQLite 3.28.0 (GH-14179)
(cherry picked from commit 7fd2ba354e)

Co-authored-by: animalize <animalize@users.noreply.github.com>
2019-06-24 16:44:07 -07:00
Miss Islington (bot) 742b16edd6
bpo-32627: Fix compile error when conflicting `_uuid` headers included (GH-11751)
(cherry picked from commit 6ffd9b05df)

Co-authored-by: ziheng <zihenglv@gmail.com>
2019-06-24 11:18:22 -07:00
Victor Stinner 20ad3310d4
bpo-37359: Add --cleanup option to python3 -m test (GH-14332) (GH-14335)
* regrtest: Add --cleanup option to remove "test_python_*" directories
  of previous failed test jobs.
* Add "make cleantest" to run "python3 -m test --cleanup".

(cherry picked from commit 47fbc4e45b)
2019-06-24 12:51:30 +02:00
Miss Islington (bot) 16ec95bb19
bpo-37362: test_gdb now ignores stderr (GH-14287)
test_gdb no longer fails if it gets an "unexpected" message on
stderr: it now ignores stderr. The purpose of test_gdb is to test
that python-gdb.py commands work as expected, not to test gdb.
(cherry picked from commit e56a123fd0)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2019-06-21 14:38:26 -07:00
Michael Felt 15e7d24322 [3.7] bpo-34347: Fix test_utf8_mode.test_cmd_line for AIX (GH-8923) (GH-14233) 2019-06-19 22:07:34 +02:00
Inada Naoki f532fe5583
bpo-27860: ipaddress: fix Interface constructor (GH-14200)
Interface constructor is documented as accepts address same to Network,
but it didn't accept some form of the address.

This commit is backport of GH-12836 (commit 6fa84bd)
2019-06-19 20:47:39 +09:00
Ned Deily 4b57543be6 Python 3.7.4rc1
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEDZbfTUEQ5cQ/v7F/LTR+pqplQh0FAl0JUcgACgkQLTR+pqpl
 Qh3vhRAA1z8RjUECPYlMj3wYtSuXnG2pvNnbK/d5Z/dRlr24mCAw6cGPJ8A9oWd3
 mOx1OIx8UJ5MxmCcgwXmoPKbJx4rZmKlDjyhXKpvF/BOFKlq1Wl62GDvjEgeQyeX
 27Vt4oYTkuD6EfCvVldeR/LHHoa49B49XdVpB8A2DoEf/xrSxsourKBJDiOGk6fa
 7WlDV/IhuD/7qAGJL/OpGrXVZpTwcar6mhpgyVZZwZFt1GTeovUsvicT4TD6B2zq
 l2A7Q/r1k74GQXsZQmVmaSVQDcewwnNw8Qv0cs3cphh4BgUG8Aaguvvh+yXaBPja
 oOTOt7nqWcyk/3ccZa1bxyw2TIEERSG1goC0eM1cMNqlyRl0bkFHf1TBJpctKOFh
 RqD8Ueiy+y7Y9+/SkGPfPdtDOJhyYVO6GJholJCmXHsCL+1nStetUqfeH/qvlJNQ
 a323y7hudImJHwGxfkxxFqb85v/R8jNgv5HmZxhd92oMZK1YW+/mr/SK9BWnp0dm
 QfHea6RaKzw1roPMnhA3mGea/JRLV0uPISLDq0UW5Qvvf6b2AGZJ6p4cHX17w5LD
 THBVUV0wDuVCu9ilclBqU+zOjqQoQAcA4T3FrnRFsFet8sGPfOf5rAfjmrv9B5Q2
 G4NJR66cHahsOD4hBXqQkdgNj3yymIG9tYK3JtPilakw4lXNpqQ=
 =aE4a
 -----END PGP SIGNATURE-----

Merge tag 'v3.7.4rc1' into 3.7
2019-06-18 23:33:33 -04:00
Miss Islington (bot) 44d46e368e
bpo-37325: Fix focus traversal for 2 IDLE dialogs (GH-14209)
Tab now moves focus across and down for Help Source and Custom Run.
(cherry picked from commit 54cf2e0780)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2019-06-18 14:26:15 -07:00
Ned Deily b26441ee1f 3.7.4rc1 2019-06-18 17:02:54 -04:00
Ned Deily 23d9fcb480 Changelog fixups for 3.7.3rc1 2019-06-18 16:45:32 -04:00
Ned Deily c730211657
bpo-36231: Support building on macOS without /usr/include (GH-13773) (GH-14208) 2019-06-18 16:28:13 -04:00
Miss Islington (bot) 452b417e34
bpo-34903: Document that some strptime formats only require 1 digit (GH-14149)
For datetime.datetime.strptime(), the leading zero for some two-digit formats is optional.

This adds a footnote to the strftime/strptime documentation to reflect this fact, and adds some tests to ensure that it is true.

bpo-34903
(cherry picked from commit 6b9c204ee7)

Co-authored-by: Mike Gleen <mike.gleen@gmail.com>
2019-06-18 11:55:27 -07:00
Miss Islington (bot) 624c9a27b1
bpo-35360: Update macOS installer to use SQLite 3.28.0 (GH-14180)
(cherry picked from commit d8f336fdc1)

Co-authored-by: animalize <animalize@users.noreply.github.com>
2019-06-18 03:24:20 -07:00
Miss Islington (bot) 0f3abbc29f
bpo-34631: Updated OpenSSL to 1.1.1c in macOS installer (GH-14187)
(cherry picked from commit f3fb8393e3)

Co-authored-by: Ned Deily <nad@python.org>
2019-06-18 01:40:05 -07:00
Miss Islington (bot) 81f7899f51
bpo-5680: IDLE: Customize running a module (GH-13763)
The initialize options are 1) add command line options, which are appended to sys.argv as if passed on a real command line, and 2) skip the shell restart. The customization dialog is accessed by a new entry on the Run menu.
(cherry picked from commit 201bc2d18b)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
2019-06-17 19:47:55 -07:00
Steve Dower 14bac00882
bpo-34631: Updated OpenSSL to 1.1.1c in Windows installer (GH-14163) 2019-06-17 15:26:43 -07:00
Miss Islington (bot) 336cf39954
bpo-37321: Edit IDLE subprocess connection error messages. (GH-14170)
Mainly, add a doc reference to message in pyshell.
(cherry picked from commit 8fac122109)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2019-06-17 14:50:48 -07:00
Miss Islington (bot) 0f31a2d3e8
bpo-37039: Make IDLE's Zoom Height adjust to users' screens (GH-13678)
Measure required height by quickly maximizing once per screen.
A search for a better method failed.
(cherry picked from commit 5bff3c86ab)

Co-authored-by: Tal Einat <taleinat+github@gmail.com>
2019-06-17 13:06:39 -07:00
Miss Islington (bot) 71589491ad bpo-37267: Do not check for FILE_TYPE_CHAR in os.dup() on Windows (GH-14051) (GH-14141)
On Windows, os.dup() no longer creates an inheritable fd when handling a
character file.
(cherry picked from commit 28fca0c422)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2019-06-17 10:45:04 +02:00
Miss Islington (bot) b101fa7783
bpo-28805: document METH_FASTCALL (GH-14079)
(cherry picked from commit 5600b5e1b2)

Co-authored-by: Jeroen Demeyer <J.Demeyer@UGent.be>
2019-06-16 16:24:06 -07:00
Miss Islington (bot) 45d6547acf
bpo-35922: Fix RobotFileParser when robots.txt has no relevant crawl delay or request rate (GH-11791)
Co-Authored-By: Tal Einat <taleinat+github@gmail.com>
(cherry picked from commit 8047e0e1c6)

Co-authored-by: Rémi Lapeyre <remi.lapeyre@henki.fr>
2019-06-16 00:10:06 -07:00
Andrew Svetlov e5d67f1e31
[3.7] bpo-37279: Fix asyncio sendfile support when extra data are sent in fallback mode. (GH-14075). (GH-14103)
(cherry picked from commit ef2152354f)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
2019-06-15 14:56:27 +03:00
Miss Islington (bot) 5e97450d83
Use threadpool for reading from file in sendfile fallback mode (GH-14076)
(cherry picked from commit 0237265e82)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
2019-06-15 04:27:10 -07:00
Miss Islington (bot) 0b592d513b
bpo-19865: ctypes.create_unicode_buffer() supports non-BMP strings on Windows (GH-14081)
(cherry picked from commit 9765efcb39)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2019-06-14 09:30:27 -07:00
Victor Stinner 33feb2e1a3
bpo-35998: Avoid TimeoutError in test_asyncio: test_start_tls_server_1() (GH-14080) (GH-14086)
(cherry picked from commit f0749da9a5)
2019-06-14 18:26:37 +02:00
Pablo Galindo 5292179afc
[3.7] bpo-37269: Correctly optimise conditionals with constant booleans (GH-14071) (GH-14073)
Fix a regression introduced by af8646c805 that was causing code of the form:

if True and False:
   do_something()

to be optimized incorrectly, eliminating the block..
(cherry picked from commit 05f8318655)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2019-06-14 07:18:51 +01:00
Miss Islington (bot) 6a433f5ae6
bpo-36779: time.tzname returns empty string on Windows if default cod… (GH-13073)
Calling setlocale(LC_CTYPE, "") on a system where GetACP() returns CP_UTF8 results in empty strings in _tzname[].

This causes time.tzname to be an empty string.
I have reported the bug to the UCRT team and will follow up, but it will take some time get a fix into production.

In the meantime one possible workaround is to temporarily change the locale by calling setlocale(LC_CTYPE, "C") before calling _tzset and restore the current locale after if the GetACP() == CP_UTF8 or CP_UTF7

@zooba

https://bugs.python.org/issue36779
(cherry picked from commit b4c7defe58)

Co-authored-by: Paul Monson <paulmon@users.noreply.github.com>
2019-06-13 06:42:46 -07:00
Miss Islington (bot) 6eb2878e42 bpo-36402: Fix threading._shutdown() race condition (GH-13948) (GH-14050) (GH-14054)
* bpo-36402: Fix threading._shutdown() race condition (GH-13948)

Fix a race condition at Python shutdown when waiting for threads.
Wait until the Python thread state of all non-daemon threads get
deleted (join all non-daemon threads), rather than just wait until
Python threads complete.

* Add threading._shutdown_locks: set of Thread._tstate_lock locks
  of non-daemon threads used by _shutdown() to wait until all Python
  thread states get deleted. See Thread._set_tstate_lock().
* Add also threading._shutdown_locks_lock to protect access to
  threading._shutdown_locks.
* Add test_finalization_shutdown() test.

(cherry picked from commit 468e5fec8a)

* bpo-36402: Fix threading.Thread._stop() (GH-14047)

Remove the _tstate_lock from _shutdown_locks, don't remove None.

(cherry picked from commit 6f75c87375)
(cherry picked from commit e40a97a721)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2019-06-13 14:22:20 +02:00
Miss Islington (bot) b4c8ef7c67
bpo-35070: test_getgrouplist may fail on macOS if too many groups (GH-13071)
(cherry picked from commit 8725c83ed5)

Co-authored-by: Jeffrey Kintscher <49998481+websurfer5@users.noreply.github.com>
2019-06-13 00:18:26 -07:00
Miss Islington (bot) d561f848b2
bpo-31829: Make protocol 0 pickles be loadable in text mode in Python 2. (GH-11859)
Escape ``\r``, ``\0`` and ``\x1a`` (end-of-file on Windows) in Unicode strings.
(cherry picked from commit 38ab7d4721)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2019-06-12 04:50:11 -07:00
Abhilash Raj 0745cc66db [3.7] bpo-36520: Email header folded incorrectly (GH-13608) (GH-13910)
* [bpo-36520](https://bugs.python.org/issue36520): reset the encoded word offset when starting a new
line during an email header folding operation

* 📜🤖 Added by blurb_it.

* [bpo-36520](https://bugs.python.org/issue36520): add an additional test case, and provide descriptive
comments for the test_folding_with_utf8_encoding_* tests

* [bpo-36520](https://bugs.python.org/issue36520): fix whitespace issue

* [bpo-36520](https://bugs.python.org/issue36520): changes per reviewer request -- remove extraneous
backslashes; add whitespace between terminating quotes and
line-continuation backslashes; use "bpo-" instead of
"issue GH-" in comments
(cherry picked from commit f6713e84af)

Co-authored-by: websurfer5 <49998481+websurfer5@users.noreply.github.com>


https://bugs.python.org/issue36520
2019-06-11 16:27:06 -07:00
Miss Islington (bot) 5d1d4e3179
bpo-36607: Eliminate RuntimeError raised by asyncio.all_tasks() (GH-13971)
If internal tasks weak set is changed by another thread during iteration.

https://bugs.python.org/issue36607
(cherry picked from commit 65aa64fae8)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
2019-06-11 09:01:20 -07:00
Raymond Hettinger 1b615b2f03
[3.7] bpo-37219: Remove erroneous optimization for differencing an empty set (GH-13965) (GH-13968) 2019-06-11 02:01:06 -07:00
Miss Islington (bot) 51c9cc73cb
bpo-37173: Show passed class in inspect.getfile error (GH-13861)
Currently, inspect.getfile(str) will report nonsense:

```pytb
>>> inspect.getfile(str)
TypeError: <module 'builtins' (built-in)> is a built-in class
```

This fixes that

https://bugs.python.org/issue37173
(cherry picked from commit d407d2a726)

Co-authored-by: Philipp A <flying-sheep@web.de>
2019-06-08 08:27:06 -07:00
Miss Islington (bot) 10b4fd9814
bpo-34886: Fix subprocess.run handling of exclusive arguments (GH-11727)
Fix an unintended ValueError from :func:`subprocess.run` when checking for
conflicting `input` and `stdin` or `capture_output` and `stdout` or `stderr` args
when they were explicitly provided but with `None` values within a passed in
`**kwargs` dict rather than as passed directly by name.
(cherry picked from commit 8cc605acdd)

Co-authored-by: Rémi Lapeyre <remi.lapeyre@henki.fr>
2019-06-08 08:24:10 -07:00
Zackery Spytz e36ed475ea [3.7] bpo-37170: Fix the cast on error in PyLong_AsUnsignedLongLongMask() (GH-13860) (GH-13896)
(cherry picked from commit dc2476500d)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2019-06-07 17:41:10 +02:00
Miss Islington (bot) 685b806549
bpo-37177: make IDLE's search dialogs transient (GH-13869)
This avoids the search dialogs being hidden behind the editor window.
(cherry picked from commit 554450fb4e)

Co-authored-by: Tal Einat <taleinat@gmail.com>
2019-06-06 23:37:32 -07:00
Miss Islington (bot) dc20fc4311 bpo-21315: Fix parsing of encoded words with missing leading ws. (GH-13425) (#13846)
* bpo-21315: Fix parsing of encoded words with missing leading ws.

Because of missing leading whitespace, encoded word would get parsed as
unstructured token. This patch fixes that by looking for encoded words when
splitting tokens with whitespace.

Missing trailing whitespace around encoded word now register a defect
instead.

Original patch suggestion by David R. Murray on bpo-21315.
(cherry picked from commit 66c4f3f38b)

Co-authored-by: Abhilash Raj <maxking@users.noreply.github.com>
2019-06-06 10:08:43 -07:00
Miss Islington (bot) 28be388e69
Don't report deleted attributes in __dir__ (GHGH-10148)
When an attribute is deleted from a Mock, a sentinel is added rather
than just deleting the attribute. This commit checks for such sentinels
when returning the child mocks in the __dir__ method as users won't
expect deleted attributes to appear when performing dir(mock).
(cherry picked from commit 0df635c7f8)

Co-authored-by: Mario Corchero <mariocj89@gmail.com>
2019-06-06 03:39:30 -07:00
Miss Islington (bot) f62a372928
bpo-30835: email: Fix AttributeError when parsing invalid CTE (GH-13598)
* bpo-30835: email: Fix AttributeError when parsing invalid Content-Transfer-Encoding

Parsing an email containing a multipart Content-Type, along with a
Content-Transfer-Encoding containing an invalid (non-ASCII-decodable) byte
will fail. email.feedparser.FeedParser._parsegen() gets the header and
attempts to convert it to lowercase before comparing it with the accepted
encodings, but as the header contains an invalid byte, it's returned as a
Header object rather than a str.

Cast the Content-Transfer-Encoding header to a str to avoid this.

Found using the AFL fuzzer.

Reported-by: Daniel Axtens <dja@axtens.net>
Signed-off-by: Andrew Donnellan <andrew@donnellan.id.au>

* Add email and NEWS entry for the bugfix.
(cherry picked from commit aa79707262)

Co-authored-by: Abhilash Raj <maxking@users.noreply.github.com>
2019-06-05 03:23:37 -07:00
Miss Islington (bot) 3d75bd15ac
bpo-35763: Make IDLE calltip note about '/' less obtrusive (GH-13791)
Add it to the end of the first line if there is room.  Tests were reworked.
(cherry picked from commit 949fe976d5)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2019-06-04 19:15:48 -07:00
Miss Islington (bot) 5f8443eec9 bpo-37153: test_venv.test_mutiprocessing() calls pool.terminate() (GH-13816) (GH-13819)
test_venv.test_mutiprocessing() now explicitly calls pool.terminate()
to wait until the pool completes.
(cherry picked from commit bc6469f79c)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2019-06-04 21:07:03 +02:00
Miss Islington (bot) cad4ff65eb
bpo-36868: Fix what's new for SSLContext.hostname_checks_common_name (GH-13248)
What's new now mentions SSLContext.hostname_checks_common_name instead of SSLContext.host_flags.

https://bugs.python.org/issue36868
(cherry picked from commit 47eb223406)

Co-authored-by: Christian Heimes <christian@python.org>
2019-06-03 12:02:11 -07:00
Miss Islington (bot) 3344197040
[3.7] bpo-37081: Test with OpenSSL 1.1.1c (GH-13631) (GH-13782)
Signed-off-by: Christian Heimes <christian@python.org>
(cherry picked from commit 06651ee418)


Co-authored-by: Christian Heimes <christian@python.org>


https://bugs.python.org/issue37081
2019-06-03 11:39:57 -07:00
Inada Naoki 8766cb74e1 [3.7] bpo-27987: align PyGC_Head to alignof(long double) (GH-13335) (GH-13581)
This reverts commit 2156fec1f7.

Now that 1b85f4ec45 is in, this change makes sense.
2019-06-02 18:51:31 -07:00
Miss Islington (bot) 6bd438e137 bpo-37014: Update docstring and Documentation of fileinput.FileInput(). (GH-13545) (GH-13753)
* bpo-37014: Update docstring and Documentation of fileinput.FileInput()

* Explain the behavior of fileinput.FileInput() when reading stdin.

* Update blurb.

* bpo-37014: Fix typo in the docstring and documentation.
(cherry picked from commit aca273e240)

Co-authored-by: Michele Angrisano <michele.angrisano@gmail.com>
2019-06-02 23:36:34 +02:00
Miss Islington (bot) b4e0bfd477
bpo-35610: IDLE - Replace .context_use_ps1 with .prompt_last_line (GH-11307)
Changes in bpo- 31858 made the less informative 'context_use_ps1' redundant.
(cherry picked from commit 6bdc4dee01)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
2019-06-02 12:35:53 -07:00
Miss Islington (bot) c76add7afd
Improve version added references in `typing` module docs (GH-13457)
(cherry picked from commit b7daabd711)

Co-authored-by: Anthony Sottile <asottile@umich.edu>
2019-06-01 17:23:40 -07:00
Miss Islington (bot) ac60d1afd2
bpo-32411: IDLE: Remove line number sort in browser.py (GH-5011)
Insertion in line order makes sorting keys by line order unneeded.
(cherry picked from commit 1a4d9ffa1a)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
2019-06-01 15:26:00 -07:00
Miss Islington (bot) f286e0373f
bpo-36813: Fix QueueListener to call task_done() upon termination. (GH-13113)
Fixed QueueListener in order to avoid random deadlocks.
Unable to add regression tests atm due to time constraints, will add it in a bit.
Regarding implementation, although it's nested, it does not cause performance issues whatsoever, and does not call task_done() in case of an exception (which is the right thing to do IMHO).

https://bugs.python.org/issue36813
(cherry picked from commit 6b282e1887)

Co-authored-by: Bar Harel <bzvi7919@gmail.com>
2019-06-01 02:36:29 -07:00
Miss Islington (bot) a6dc5d4e1c bpo-33361: Fix bug with seeking in StreamRecoders (GH-8278)
(cherry picked from commit a6ec1ce1ac)

Co-authored-by: Ammar Askar <ammar_askar@hotmail.com>
2019-05-31 23:03:22 +03:00
Miss Islington (bot) 49fc57abf5
bpo-12639: msilib.Directory.start_component() fails if *keyfile* is not None (GH-13688)
msilib.Directory.start_component() was passing an extra argument to CAB.gen_id().
(cherry picked from commit c8d5bf6c3f)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2019-05-31 10:22:14 -07:00
Miss Islington (bot) fc3b8437c8
bpo-25735: math.factorial doc should mention integer return type (GH-6420)
(cherry picked from commit 4612671df2)

Co-authored-by: Akshay Sharma <akshay.sharma09695@gmail.com>
2019-05-31 09:58:27 -07:00
Miss Islington (bot) f1487b3235 bpo-24564: shutil.copystat(): ignore EINVAL on os.setxattr() (GH-13369)
(cherry picked from commit a16387ab2d)

Co-authored-by: Ying Wang <me@yingw787.com>
2019-05-30 13:58:30 +08:00
Anthony Sottile 3a98bbf727 [3.7] bpo-36983: Fix typing.__all__ and add test for exported names (GH-13456) (GH-13662)
https://bugs.python.org/issue36983

Fixes issue 36983
2019-05-29 21:05:33 -07:00
Miss Islington (bot) 8ea0fd85bc bpo-26903: Limit ProcessPoolExecutor to 61 workers on Windows (GH-13132) (GH-13643)
Co-Authored-By: brianquinlan <brian@sweetapp.com>
(cherry picked from commit 39889864c0)

Co-authored-by: Brian Quinlan <brian@sweetapp.com>
2019-05-28 23:12:30 -04:00
Miss Islington (bot) 0eb69990c8
bpo-22102: Fixes zip files with disks set to 0 (GH-5985)
(cherry picked from commit ab0716ed1e)

Co-authored-by: Francisco Facioni <fran6co@gmail.com>
2019-05-28 16:33:21 -07:00
Miss Islington (bot) e7ddf586ae
bpo-26423: Fix possible overflow in wrap_lenfunc() (GH-13606)
Fix possible overflow in wrap_lenfunc() when
sizeof(long) < sizeof(Py_ssize_t) (e.g., 64-bit Windows).
(cherry picked from commit 05f16416d9)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2019-05-28 06:17:43 -07:00
Miss Islington (bot) 0f352d44e7
bpo-37054, _pyio: Fix BytesIO and TextIOWrapper __del__() (GH-13601)
Fix destructor _pyio.BytesIO and _pyio.TextIOWrapper: initialize
their _buffer attribute as soon as possible (in the class body),
because it's used by __del__() which calls close().
(cherry picked from commit a3568417c4)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2019-05-27 17:05:49 -07:00
Andrew Svetlov a79b6c578f
[3.7] bpo-37035: Don't log OSError (GH-13548) (#13594)
https://bugs.python.org/issue37035.
(cherry picked from commit 1f39c28e48)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
2019-05-27 18:52:05 +03:00
Miss Islington (bot) bfd0b77201
[3.7] bpo-28866: No type cache for types with specialized mro, invalidation is hard. (GH-13157) (GH-13589)
* No type cache for types with specialized mro, invalidation is hard.

* FIX: Don't disable method cache custom types that do not implement mro().

* fixing implem.

* Avoid storing error flags, also decref.

* news entry

* Clear as soon as we're getting an error.

* FIX: Reference leak.
(cherry picked from commit 180dc1b0f4)


Co-authored-by: Julien Palard <julien@palard.fr>


https://bugs.python.org/issue28866
2019-05-26 15:14:23 -07:00
Michael Blahay f3d909428c BPO-27639: Correct return type for UserList slicing operation (#13203)
Added logic to __getitem__ magic method for UserList to ensure that the return
type matches that of self.
2019-05-26 15:28:09 +01:00
Miss Islington (bot) 1b85f4ec45
bpo-27987: pymalloc: align by 16bytes on 64bit platform (GH-12850)
(cherry picked from commit f0be4bbb9b)

Co-authored-by: Inada Naoki <songofacandy@gmail.com>
2019-05-25 10:18:34 -07:00
Gregory P. Smith 2156fec1f7
[3.7] Revert "align PyGC_Head to alignof(long double) (GH-13335)" (GH-13569)
This reverts commit ea2b76bdc5.
See the bug for discussion.

https://bugs.python.org/issue27987
2019-05-25 10:05:01 -07:00
Inada Naoki ea2b76bdc5
bpo-27987: align PyGC_Head to alignof(long double) (GH-13335) 2019-05-25 21:13:33 +09:00
Miss Islington (bot) c70ab1cca0
bpo-37038: Make idlelib.run runnable; add test clause (GH-13560)
(cherry picked from commit 81bb97df61)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2019-05-24 22:10:09 -07:00
Victor Stinner cee4ac8135
bpo-35907: Clarify the NEWS entry (GH-13558) 2019-05-24 23:29:10 +02:00
Miss Islington (bot) 310f414bbd
bpo-23395: Fix PyErr_SetInterrupt if the SIGINT signal is ignored or not handled (GH-7778)
``_thread.interrupt_main()`` now avoids setting the Python error status if the ``SIGINT`` signal is ignored or not handled by Python.
(cherry picked from commit 608876b6b1)

Co-authored-by: Matěj Cepl <mcepl@cepl.eu>
2019-05-24 02:22:38 -07:00
Miss Islington (bot) 7cc47e9c19
bpo-37008: make mock_open handle able to honor next() (GH-13492)
I've reported the issue on https://bugs.python.org/issue37008 and now I'm trying to bring a solution to this minor issue.

I think it could be trivially backported to 3.7 branch.

https://bugs.python.org/issue37008
(cherry picked from commit 394119afc6)

Co-authored-by: Damien Nadé <Anvil@users.noreply.github.com>
2019-05-23 03:21:11 -07:00
Miss Islington (bot) 0416d6f05a bpo-27737: Allow whitespace only headers encoding (GH-13478) (#13517)
(cherry picked from commit ef5bb25e2d)

Co-authored-by: Batuhan Taşkaya <47358913+isidentical@users.noreply.github.com>
2019-05-22 21:41:43 -04:00
Miss Islington (bot) b73c21c0be
bpo-33110: Catch errors raised when running add_done_callback on already completed futures (GH-13141)
Wrap the callback call within the `add_done_callback` function within concurrent.futures, in order to behave in an identical manner to callbacks added to a running future are triggered once it has completed.
(cherry picked from commit 2a3a2ece50)

Co-authored-by: Sam Martin <ABitMoreDepth@users.noreply.github.com>
2019-05-22 15:02:24 -07:00
Victor Stinner 34bab21559
bpo-35907, CVE-2019-9948: urllib rejects local_file:// scheme (GH-13474) (GH-13505)
CVE-2019-9948: Avoid file reading as disallowing the unnecessary URL
scheme in URLopener().open() and URLopener().retrieve()
of urllib.request.

Co-Authored-By: SH <push0ebp@gmail.com>
(cherry picked from commit 0c2b6a3943)
2019-05-22 23:28:28 +02:00
Jelle Zijlstra 81c5ec9e41 [3.7] bpo-33482: fix codecs.StreamRecoder.writelines (GH-6779) (GH-13502)
A very simple fix. I found this while writing typeshed stubs for StreamRecoder.

https://bugs.python.org/issue33482.
(cherry picked from commit b3be407288)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>





https://bugs.python.org/issue33482
2019-05-22 09:28:38 -07:00
Victor Stinner a58db9628d
bpo-36829: Enhance PyErr_WriteUnraisable() (GH-13487)
PyErr_WriteUnraisable() now displays the exception even if displaying
the traceback failed. Moreover, hold a strong reference to sys.stderr
while using it.

Document that an exception must be set when calling
PyErr_WriteUnraisable(), but don't add an assertion to check it at
runtime.

Cleanup: use longer names for variables and create
write_unraisable_exc_file() subfunction.
2019-05-22 18:23:28 +02:00
Jeroen Demeyer d092caf096 bpo-36907: fix refcount bug in _PyStack_UnpackDict() (GH-13381) (GH-13493) 2019-05-22 14:52:13 +02:00
Erik Janssens 791e5fcbab bpo-36965: Fix includes in main.c on Windows with non-MSC compilers (GH-13421) (GH-13471)
Include windows.h rather than crtdbg.h to get STATUS_CONTROL_C_EXIT constant.
Moreover, include windows.h on Windows, not only when MSC is used.

(cherry picked from commit 925af1d99b)
2019-05-22 13:04:06 +02:00
Miss Islington (bot) aea49b1875
[3.7] bpo-36035: fix Path.rglob for broken links (GH-11988) (GH-13469)
Links creating an infinite symlink loop would raise an exception.
(cherry picked from commit d5c120f7eb)


Co-authored-by: Jörg Stucke <joerg.stucke@fkie.fraunhofer.de>


https://bugs.python.org/issue36035
2019-05-21 12:05:08 -07:00
Miss Islington (bot) 6b48e658bf
bpo-36929: Modify io/re tests to allow for missing mod name (GH-13392)
* bpo-36929: Modify io/re tests to allow for missing mod name

For a vanishingly small number of internal types, CPython sets the
tp_name slot to mod_name.type_name, either in the PyTypeObject or the
PyType_Spec. There are a few minor places where this surfaces:

* Custom repr functions for those types (some of which ignore the
  tp_name in favor of using a string literal, such as _io.TextIOWrapper)
* Pickling error messages

The test suite only tests the former. This commit modifies the test
suite to allow Python implementations to omit the module prefix.

https://bugs.python.org/issue36929
(cherry picked from commit ccb7ca728e)

Co-authored-by: Max Bernstein <tekknolagi@users.noreply.github.com>
2019-05-21 10:51:56 -07:00
Miss Islington (bot) 3c9c2dc8dd
bpo-34144: Fix of venv acvtivate.bat for win 10 (GH-8321)
The script needs to be updated to support win 10/ 1803 chcp.com command (output has trailing dot)

https://bugs.python.org/issue34144
(cherry picked from commit 6955d44b41)

Co-authored-by: Lorenz Mende <Lorenz.mende@gmail.com>
2019-05-21 08:41:44 -07:00
Geoff Shannon cdb2dbfe92 [3.7] bpo-22865: Expand on documentation for the pty.spawn function (GH-11980) (GH-13455)
(cherry picked from commit 522ccef869)

Co-authored-by: Geoff Shannon <earthlingzephyr@gmail.com>
2019-05-21 11:36:57 +02:00
Miss Islington (bot) 50b3f205d8
bpo-36969: Make PDB args command display keyword only arguments (GH-13452)
(cherry picked from commit bf457c7d82)

Co-authored-by: Rémi Lapeyre <remi.lapeyre@henki.fr>
2019-05-20 15:34:23 -07:00
Miss Islington (bot) 3887932e10
bpo-35721: Close socket pair if Popen in _UnixSubprocessTransport fails (GH-11553)
This slightly expands an existing test case `test_popen_error` to trigger a `ResourceWarning` and fixes it.

https://bugs.python.org/issue35721
(cherry picked from commit 9932fd91e8)

Co-authored-by: Niklas Fiekas <niklas.fiekas@backscattering.de>
2019-05-20 05:35:56 -07:00
Miss Islington (bot) 2d94d4f1a5
bpo-36958: In IDLE, print exit message (GH-13435)
Print any argument other than None or int passed to SystemExit
or sys.exit().
(cherry picked from commit 6d965b39b7)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2019-05-20 00:16:53 -07:00