Commit Graph

103294 Commits

Author SHA1 Message Date
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) 30cac20101
Update weakref.rst (GH-14098)
(cherry picked from commit f475729a71)

Co-authored-by: Géry Ogam <gery.ogam@gmail.com>
2019-06-15 04:50:11 -07: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
Miss Islington (bot) 0bd1469a90
Update concurrent.futures.rst (GH-14061)
This PR adds missing details in the [`concurrent.futures`](https://docs.python.org/3/library/concurrent.futures.html) documentation:

* the mention that `Future.cancel` also returns `False` if the call finished running;
* the mention of the states for `Future` that did not complete: pending or running.
(cherry picked from commit 431478d5d7)

Co-authored-by: Géry Ogam <gery.ogam@gmail.com>
2019-06-14 07:52:14 -07: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
Miss Islington (bot) 534136ac67
bpo-29505: Fuzz json module, enforce size limit on int(x) fuzz (GH-13991)
* bpo-29505: Enable fuzz testing of the json module, enforce size limit on int(x) fuzz and json input size to avoid timeouts.

Contributed by by Ammar Askar for Google.
(cherry picked from commit a6e190e94b)

Co-authored-by: Ammar Askar <aaskar@google.com>
2019-06-11 21:47:42 -07:00
Miss Islington (bot) f0cc1a91f7
bpo-32625: Updated documentation for EXTENDED_ARG. (GH-13985)
Python 3.6 changed the size of bytecode instruction, while the documentation for `EXTENDED_ARG` was not updated accordingly.
(cherry picked from commit 405f648db7)

Co-authored-by: Yao Zuo <laike9m@users.noreply.github.com>
2019-06-11 20:51:42 -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) 22e8a6d013
Fix test_posix if RWF_HIPRI is defined but not preadv2. (GH-13980)
If preadv2 is not available, preadv will raise NotImplementedError.
(cherry picked from commit 44867bb937)

Co-authored-by: Benjamin Peterson <benjamin@python.org>
2019-06-11 10:33:36 -07:00
Miss Islington (bot) fad89046e1
closes bpo-33758: Skip test_get_type_hints_modules_forwardref. (GH-13977)
This test "works" if things are run in the right order, so it's better to use @skip than @expectedFailure here.
(cherry picked from commit 910b3fcb01)

Co-authored-by: Benjamin Peterson <benjamin@python.org>
2019-06-11 09:52:15 -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
Makdon c59b1bbbb3 [3.7] bpo-37216: Fix version and filename in Mac using document (GH-13963) 2019-06-11 01:38:25 -04:00
Miss Islington (bot) 30fd7a476b
closes bpo-35184: Fix XML_POOR_ENTROPY option that breaks makesetup parsing of pyexpat line in Setup. (GH-13064)
When the line is uncommented, the equals character causes it to be incorrectly interpreted
as a macro definition by makesetup.  This results in invalid Makefile output.

The expat code only requires XML_POOR_ENTROPY to be defined; the value is unnecessary.
(cherry picked from commit 408a2ef1ac)

Co-authored-by: aaronpaulhurst <aaronpaulhurst@gmail.com>
2019-06-10 19:15:24 -07:00
Miss Islington (bot) 3621bf20e9
Stop using deprecated logging API in Sphinx suspicious checker (GH-9875)
(cherry picked from commit ee171a26c1)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2019-06-08 17:53:20 -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
Miss Islington (bot) 6692d35317
bpo-29505: Fix interpreter in fuzzing targets to be relocatable (GH-13907)
(cherry picked from commit a15a7bcaea)

Co-authored-by: Ammar Askar <ammar@ammaraskar.com>
2019-06-08 08:03:46 -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) 4ea9dbda4a Use assertEqual(). (#13886) 2019-06-07 11:47:16 +02:00
Miss Islington (bot) f09d91552c
IDLE: Standardize naming convention for DummyEditwin in tests (GH-13876)
* Change from Dummy_Editwin to DummyEditwin to match other tests.
(cherry picked from commit 7f8a38a7c4)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
2019-06-07 02:29:03 -07:00
Miss Islington (bot) 8f0bbbdcae bpo-37188: Fix a divide-by-zero in arrays of size-0 objects (GH-13881) (#13882) 2019-06-07 10:34:14 +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) beba8c7fd3
Doc: Python 3.9 in sidebar and version switcher. (GH-13824)
(cherry picked from commit 59e7bbcaa4)

Co-authored-by: Julien Palard <julien@palard.fr>
2019-06-04 16:21:34 -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) 250b62acc5
bpo-36742: Corrects fix to handle decomposition in usernames (GH-13812)
(cherry picked from commit 8d0ef0b5ed)

Co-authored-by: Steve Dower <steve.dower@python.org>
2019-06-04 09:15:13 -07:00
Miss Islington (bot) 12c178799a
bpo-30699: Improve example on datetime tzinfo instances (GH-4290)
* Improve example on tzinfo instances

Move from GMTX to TZX when naming the classes, as GMT1 might be rather
confusing as seen in the reported issue.
In addition, move to UTC over GMT and improve the tzname implementation.

* Simplify datetime with tzinfo example

Move the example in the documentation to just use timezone.utc and a
user defined Kabul timezone rather than having two user defined
timezones with DST.

Kabul timezone is still interesting as it changes its offset but not
based on DST. This is more accurate as the previous example was missing
information about the fold attribute. Additionally, implementing the fold
attribute was rather complex and probably not relevant enough for the
section "datetime with tzinfo".
(cherry picked from commit f0b5ae4567)

Co-authored-by: Mario Corchero <mcorcherojim@bloomberg.net>
2019-06-04 08:25:16 -07: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
Miss Islington (bot) 15bde92e47
Doc fix: duplicate object description of email.message (GH-13742)
(cherry picked from commit 141da44bb4)

Co-authored-by: Julien Palard <julien@palard.fr>
2019-06-03 08:25:52 -07:00
Miss Islington (bot) ab4d42a33e
IDLE: Fix typos in docs and comments (GH-13749)
(cherry picked from commit d9677f36fe)

Co-authored-by: Xtreak <tir.karthi@gmail.com>
2019-06-02 21:39:32 -07:00
Miss Islington (bot) 4a941e6982
Fix variable name copy/paste error in build-installer.py (GH-13038)
(cherry picked from commit d337169156)

Co-authored-by: cclauss <cclauss@me.com>
2019-06-02 20:36:33 -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) 9390e98c3e bpo-19184: Update the documentation of dis module. (GH-13652) (GH-13755)
* bpo-19184: Update the documentation of dis module

* Explain the behavior of the number of arguments of RAISE_VARGARGS
  opcode.

* bpo-19184: Update blurb.

* bpo-19184: Fix typo in the dis Documentation.

* bpo-19184: Address review comments and improve the doc

* bpo-19184: Remove news file.
(cherry picked from commit e1179a5096)

Co-authored-by: Michele Angrisano <michele.angrisano@gmail.com>
2019-06-03 01:18:50 +02: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) fefdc00990
Fix the error handling in bytesio_sizeof(). (GH-10459)
bytesio_sizeof() must check if an error has occurred in _PySys_GetSizeOf().
(cherry picked from commit 36dcaab7fd)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2019-06-01 14:58:33 -07:00
Miss Islington (bot) fc914dd5e0
Doc: Correct the creation year and the credits of the Logo Programming language (GH-13520)
(cherry picked from commit 66501058fe)

Co-authored-by: Stéphane Wirtel <stephane@wirtel.be>
2019-06-01 04:47:15 -07:00