Commit Graph

43862 Commits

Author SHA1 Message Date
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) 695d7ad710
bpo-37393: Fix deprecation warnings in test_ntpath. (GH-14357)
eval() was being called an extra time without a filter for
deprecation warnings.
(cherry picked from commit 9fe42b49c7)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2019-06-25 00:12:29 -07:00
Miss Islington (bot) c9015a7228
bpo-37124: Fix reference leak in test_msilib (GH-13750)
(cherry picked from commit c0295dba25)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2019-06-24 04:56:17 -07:00
Miss Islington (bot) 5779898a1f
bpo-37359: Fix regrtest --cleanup (GH-14336)
(cherry picked from commit 9bbf4d7083)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2019-06-24 04:43:16 -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) e24dbe79ba
Improve threading.daemon docstring (GH-14278)
Rephrase and clarify that "the entire Python program exits when only daemon threads are left". This matches the documentation at https://docs.python.org/3/library/threading.htmlGH-thread-objects.
(cherry picked from commit bb110cc2ed)

Co-authored-by: mbarkhau <mbarkhau@gmail.com>
2019-06-23 12:05:10 -07: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
Miss Islington (bot) 5ee21732ee Fix typo, 'widger' -> 'widget', in idlelib/tree.py (GH-14263) (#14271)
(cherry picked from commit 8713aa6dfb)

Co-authored-by: İsmail Arılık <arilik.ismail@gmail.com>
2019-06-20 12:50:53 -04: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
Miss Islington (bot) 9eb4b2c8a3 bpo-37258: Not a bug, but added a unit test and updated documentation. (GH-14229) (GH-14231)
(cherry picked from commit 0150001653)
2019-06-19 14:46:19 +01: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
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) c101d1a88a bpo-35031: also disable TLS 1.3 for test_start_tls_server_1 on macOS (GH-14188) (GH-14192)
(cherry picked from commit a514f782b8)

Co-authored-by: Ned Deily <nad@python.org>
2019-06-18 05:45:10 -04: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
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) 0040903bba
bpo-35031, test_asycio: disable TLS 1.3 in test_start_tls_server_1() (GH-14148)
bpo-35031, bpo-35998: Reintroduce workaround on Windows and FreeBSD
in test_start_tls_server_1() of test_asyncio: disable TLS v1.3 on the
client context.
(cherry picked from commit c034b7824f)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2019-06-17 03:10:48 -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) 351b0e793e
bpo-36688: Adding an implementation of RLock in _dummy_thread (GH-12943)
(cherry picked from commit c5905f39bc)

Co-authored-by: Joost Lek <vlabakje@gmail.com>
2019-06-17 01:28:43 -07:00
Miss Islington (bot) 0c45aee803
bpo-37220: Fix 2.7 test -R crash on Windows. (GH-13957)
The patch needed for 2.7 should make the test more stable on 3.x also.
(cherry picked from commit 66d47da86a)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2019-06-16 13:52:25 -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
Miss Islington (bot) d799fd3468
Fix typo in Lib/concurrent/futures/thread.py (GH-13953)
(cherry picked from commit 552ace7498)

Co-authored-by: ubordignon <48903745+ubordignon@users.noreply.github.com>
2019-06-15 05:11:15 -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) 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) 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) 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
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) 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) 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) 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) 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) 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) ee114d7795
IDLE - Capitalize search dialogs' 'Close' button label. (GH-13691)
It seems to be the only widget label not capitalized.
(cherry picked from commit ba0430211f)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2019-05-31 01:44:29 -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
Miss Islington (bot) abdda3ae2a
bpo-37039: IDLE - zoomheight fixes (GH-13576)
Move doc entry to match menu and refactor zoom function.
A followup patch will include a blurb.
(cherry picked from commit df9b032f47)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2019-05-27 16:48:04 -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
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) 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
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
Jeroen Demeyer d092caf096 bpo-36907: fix refcount bug in _PyStack_UnpackDict() (GH-13381) (GH-13493) 2019-05-22 14:52:13 +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
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
Miss Islington (bot) f393e8eb46 bpo-29183: Fix double exceptions in wsgiref.handlers.BaseHandler (GH-12914)
(cherry picked from commit 7c59362a15)

Co-authored-by: Berker Peksag <berker.peksag@gmail.com>
2019-05-19 19:28:38 +03:00
Miss Islington (bot) 3645d29a1d
bpo-27141: Fix collections.UserList and UserDict shallow copy. (GH-4094)
(cherry picked from commit f4e1babf44)

Co-authored-by: Bar Harel <bzvi7919@gmail.com>
2019-05-19 07:26:35 -07:00
Miss Islington (bot) 5386aaf078
bpo-33524: Fix the folding of email header when max_line_length is 0 or None (GH-13391)
and there are non-ascii characters in the header.
(cherry picked from commit feac6cd775)

Co-authored-by: Abhilash Raj <maxking@users.noreply.github.com>
2019-05-17 13:47:12 -07:00
Miss Islington (bot) ced80d8ce2 Simplify SSLSocket / SSLObject doc string (GH-9972) (GH-13384)
Instead of maintaining the same docstring two times, let's copy common
docstrings from SSLObject methods and properties to SSLSocket.

(cherry picked from commit 80ed353329)

Co-authored-by: Christian Heimes <christian@python.org>
2019-05-17 13:29:35 +02:00
Miss Islington (bot) 85ed1712e4
bpo-1875: Raise SyntaxError in invalid blocks that will be optimised away (GH-13332)
Move the check for dead conditionals (if 0) to the peephole optimizer
and make sure that the code block is still compiled to report any
existing syntax errors within.
(cherry picked from commit af8646c805)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2019-05-17 03:59:48 -07:00
Miss Islington (bot) 94704048e2
bpo-35545: Fix asyncio discarding IPv6 scopes (GH-11271)
This PR proposes a solution to [bpo-35545](https://bugs.python.org/issue35545) by adding an optional `flowinfo` and `scopeid` to `asyncio.base_events._ipaddr_info` to carry the full address information into `_ipaddr_info` and avoid discarding IPv6 specific information.

Changelog entry & regression tests to come.

https://bugs.python.org/issue35545
(cherry picked from commit ac8eb8f36b)

Co-authored-by: Erwan Le Pape <lepaperwan@users.noreply.github.com>
2019-05-17 02:05:19 -07:00
Miss Islington (bot) f02d1a43c6
bpo-36946: Fix possible signed integer overflow when handling slices. (GH-13375)
The final addition (cur += step) may overflow, so use size_t for "cur".
"cur" is always positive (even for negative steps), so it is safe to use
size_t here.

Co-Authored-By: Martin Panter <vadmium+py@gmail.com>
(cherry picked from commit 14514d9084)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2019-05-17 00:33:10 -07:00
Steve Dower aa73841a8f
bpo-35926: Add support for OpenSSL 1.1.1b on Windows (GH-11779) 2019-05-16 09:41:36 -07:00
Miss Islington (bot) 876756e4a1
Fix typos in documentation. Patch by tirkarthi. (GH-13354)
(cherry picked from commit 8a533ffb49)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2019-05-15 22:38:31 -07:00
Miss Islington (bot) 78dd781ef4 bpo-36015: Handle StreamHandler representaton of stream with an integer name (GH-11908) (GH-13183)
(cherry picked from commit ca87eebb22)

Co-authored-by: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com>
2019-05-15 19:06:29 +01:00
Victor Stinner c647ad9b51
Revert "bpo-36801: Fix waiting in StreamWriter.drain for closing SSL transport (GH-13098)" (GH-13328)
This reverts commit 93aa57ac65.
2019-05-14 22:29:54 +02:00
Miss Islington (bot) 2fef5b01e3 bpo-33529, email: Fix infinite loop in email header encoding (GH-12020) (GH-13321)
(cherry picked from commit c1f5667be1)

Co-authored-by: Krzysztof Wojcik <wojcikk2903@users.noreply.github.com>
2019-05-14 22:12:46 +02:00
Miss Islington (bot) ecd668d6d9
bpo-36915: regrtest always remove tempdir of worker processes (GH-13312)
When using multiprocessing (-jN option), worker processes now create
their temporary directory inside the temporary directory of the
main process. So the main process is able to remove temporary
directories of worker processes even if they crash or when they are
killed by regrtest on KeyboardInterrupt (CTRL+c).

Rework also how multiprocessing arguments are parsed in main.py.
(cherry picked from commit 3c93153f7d)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2019-05-14 08:25:06 -07:00
Miss Islington (bot) d8e123a48f bpo-36719: Fix regrtest MultiprocessThread (GH-13301) (GH-13303)
MultiprocessThread.kill() now closes stdout and stderr to prevent
popen.communicate() to hang.
(cherry picked from commit c923c3449f)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2019-05-14 14:12:49 +02:00
Miss Islington (bot) 30cccf084d bpo-36845: validate integer network prefix when constructing IP networks (GH-13298)
(cherry picked from commit 5e48e3db6f)

Co-authored-by: Nicolai Moore <niconorsk@gmail.com>
2019-05-14 20:00:16 +09:00
Miss Islington (bot) 0a5b88e7f2 bpo-24538: Fix bug in shutil involving the copying of xattrs to read-only files. (PR-13212) (#13234)
Extended attributes can only be set on user-writeable files, but shutil previously
first chmod()ed the destination file to the source's permissions and then tried to
copy xattrs. This will cause failures if attempting to copy read-only files with
xattrs, as occurs with Git clones on Lustre FS.
(cherry picked from commit 79efbb7193)

Co-authored-by: Olexa Bilaniuk <obilaniu@users.noreply.github.com>
2019-05-14 13:30:22 +08:00
Miss Islington (bot) c0abd0c8e9
bpo-34424: Handle different policy.linesep lengths correctly. (GH-8803)
(cherry picked from commit 45b2f8893c)

Co-authored-by: Jens Troeger <jenstroeger@users.noreply.github.com>
2019-05-13 19:02:46 -07:00
Miss Islington (bot) 19464bcd97
bpo-36719: regrtest -jN no longer stops on crash (GH-13231)
"python3 -m test -jN ..." now continues the execution of next tests
when a worker process crash (CHILD_ERROR state). Previously, the test
suite stopped immediately. Use --failfast to stop at the first error.

Moreover, --forever now also implies --failfast.
(cherry picked from commit b0917df329)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2019-05-13 10:55:07 -07:00
Miss Islington (bot) 68a11b6e6a [3.7] bpo-36807: When saving a file in IDLE, call flush and fsync (GH-13102) (#13288)
Includes blurb fix in 85c69d5
(cherry picked from commit 4f098b35f5)
2019-05-13 12:58:42 -04:00
Miss Islington (bot) 744129db5d bpo-36903: Fix ResourceWarning in test_logging (GH-13283) (GH-13285)
(cherry picked from commit 2c10538d11)

Co-authored-by: Xtreak <tir.karthi@gmail.com>
2019-05-13 17:39:50 +02:00
Gregory P. Smith 6daaf3f7de [3.7] bpo-36816: Update the self-signed.pythontest.net cert (GH-13192) (GH-13197)
We updated the server, our testsuite must match.

https://bugs.python.org/issue36816

✈️ CLE -> DEN ✈️ #pycon2019 #beyonce
(cherry picked from commit 6bd81734de)

Authored-by: Gregory P. Smith <greg@krypto.org>


https://bugs.python.org/issue36816
2019-05-08 14:13:08 -07:00
Miss Islington (bot) 93aa57ac65
bpo-36801: Fix waiting in StreamWriter.drain for closing SSL transport (GH-13098)
https://bugs.python.org/issue36801
(cherry picked from commit 1cc0ee7d9f)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
2019-05-07 14:48:35 -07:00
Gregory P. Smith 3b4b28efbd
[3.7] bpo-36533: Reinit logging.Handler locks on fork(). (GH-12704) (GH-13170)
Instead of attempting to acquire and release them all across fork
which was leading to deadlocks in some applications that had chained
their own handlers while holding multiple locks.
(cherry picked from commit 64aa6d2000)

Co-authored-by: Gregory P. Smith <greg@krypto.org>  [Google LLC]
2019-05-07 16:29:41 -04:00
Miss Islington (bot) 299f69c24c
bpo-35125: remove inner callback on outer cancellation in asyncio shield (GH-10340)
When the future returned by shield is cancelled, its completion callback of the
inner future is not removed. This makes the callback list of inner inner future
grow each time a shield is created and cancelled.

This change unregisters the callback from the inner future when the outer
future is cancelled.

https://bugs.python.org/issue35125
(cherry picked from commit b35acc5b3a)

Co-authored-by: Romain Picard <romain.picard@oakbits.com>
2019-05-07 12:38:00 -07:00
Miss Islington (bot) 19ca5b500a
bpo-31922: Do not connect UDP sockets when broadcast is allowed (GH-423)
*Moved from python/asyncioGH-493.*

This PR fixes issue python/asyncioGH-480, as explained in [this comment](https://github.com/python/asyncio/issues/480GH-issuecomment-278703828).

The `_SelectorDatagramTransport.sendto` method has to be modified ~~so `_sock.sendto` is used in all cases (because it is tricky to reliably tell if the socket is connected or not). Could that be an issue for connected sockets?~~ *EDIT* ... so `_sock.send` is used only if `_sock` is connected.

It also protects `socket.getsockname` against `OSError` in `_SelectorTransport`. This might happen on Windows if the socket is not connected (e.g. for UDP broadcasting).

https://bugs.python.org/issue31922
(cherry picked from commit 63deaa5b70)

Co-authored-by: Vincent Michel <vxgmichel@gmail.com>
2019-05-07 10:45:53 -07:00
Miro Hrončok 7e200e0763 bpo-30458: Disallow control chars in http URLs. (GH-12755) (GH-13154)
Disallow control chars in http URLs in urllib.urlopen.  This addresses a potential security problem for applications that do not sanity check their URLs where http request headers could be injected.

Disable https related urllib tests on a build without ssl (GH-13032)
These tests require an SSL enabled build. Skip these tests when python is built without SSL to fix test failures.

Use http.client.InvalidURL instead of ValueError as the new error case's exception. (GH-13044)

Backport Co-Authored-By: Miro Hrončok <miro@hroncok.cz>
2019-05-07 11:28:47 -04:00
Miss Islington (bot) a6516f89aa bpo-31855: unittest.mock.mock_open() results now respects the argument of read([size]) (GH-11521) (#13152)
unittest.mock.mock_open() results now respects the argument of read([size])

Co-Authored-By: remilapeyre <remi.lapeyre@henki.fr>
(cherry picked from commit 11a8832c98)

Co-authored-by: Rémi Lapeyre <remi.lapeyre@henki.fr>
2019-05-07 13:34:48 +01:00
Miss Islington (bot) ffa29b5aca
bpo-35925: Skip SSL tests that fail due to weak external certs. (GH-13124)
Modern Linux distros such as Debian Buster have default OpenSSL system
configurations that reject connections to servers with weak certificates
by default.  This causes our test suite run with external networking
resources enabled to skip these tests when they encounter such a failure.

Fixing the network servers is a separate issue.
(cherry picked from commit 2cc0223f43)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2019-05-06 20:51:25 -07:00
penguindustin b2d29bfa5b [3.7] bpo-36766: Typos in docs and code comments (GH-13116). (GH-13136)
(cherry picked from commit 9646630895)

Co-authored-by: penguindustin <penguindustin@gmail.com>





https://bugs.python.org/issue36766
2019-05-06 13:55:19 -07:00
Miss Islington (bot) 905ce9eeb1
simplify StartupImportTests (GH-13096)
_osx_support and copyreg are not imported from site on macOS for now.
(cherry picked from commit c4d92c8ada)

Co-authored-by: Inada Naoki <songofacandy@gmail.com>
2019-05-05 02:25:16 -07:00
Miss Islington (bot) 769ac7e7b8
bpo-36613: call remove_done_callback if exception (GH-12800)
Call remove_done_callback() in finally block.

https://bugs.python.org/issue36613
(cherry picked from commit c1964e9e21)

Co-authored-by: gescheit <gescheit12@gmail.com>
2019-05-03 08:35:52 -07:00
Terry Jan Reedy 304ca211c4
[3.7] bpo-34162: Fix idlelib/NEWS.text for 3.7.4 (#13067) 2019-05-02 15:34:01 -04:00
Miss Islington (bot) e85ba1e692 [3.7] bpo-14546: Fix the argument handling in Tools/scripts/lll.py (GH-13026) (GH-13060)
(cherry picked from commit c4e78b116f)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2019-05-02 15:29:06 -04:00
Miss Islington (bot) 3f8f64ebf3 bpo-35726: Add test for QueueHandler with multiple handlers (GH-11659) (GH-13061)
(cherry picked from commit 2dad96013c)

Co-authored-by: Xtreak <tir.karthi@gmail.com>
2019-05-02 13:24:01 -04:00
Xtreak 386b6f07a9 [3.7] bpo-35726: Prevented QueueHandler formatting from affecting other handlers (GH-11537) (GH-12716)
QueueHandler.prepare() now makes a copy of the record before modifying and enqueueing it, to avoid affecting other handlers in the chain.
(cherry picked from commit da6424e96a)

Co-authored-by: Manjusaka <lizheao940510@gmail.com>
2019-05-02 13:02:42 -04:00
Miss Islington (bot) 0ff08b061b
Change bisect to bisect_cmd in docstring (GH-13040)
(cherry picked from commit 11e4a941e9)

Co-authored-by: Xtreak <tir.karthi@gmail.com>
2019-05-01 20:10:12 -07:00
Miss Islington (bot) 47ffc1a9f6 bpo-27682: Handle client connection terminations in wsgiref (GH-9713)
(cherry picked from commit 3d37ea25dc)

Co-authored-by: Petter Strandmark <petter.strandmark@gmail.com>
2019-05-01 20:52:40 +03:00
Miss Islington (bot) 4d723e76e1
bpo-36742: Fixes handling of pre-normalization characters in urlsplit() (GH-13017)
(cherry picked from commit d537ab0ff9)

Co-authored-by: Steve Dower <steve.dower@python.org>
2019-04-30 05:21:02 -07:00
Victor Stinner 5e09a9973b
bpo-35952: Sync test.pythoninfo from master (GH-13009) 2019-04-29 15:20:27 +02:00
Miss Islington (bot) 5d90954856
Syntax highlight IDLE html doc code example. (GH-12981)
The new markup is currently ignored by IDLE's tk doc display.
(cherry picked from commit 55d035113d)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2019-04-26 20:42:05 -07:00
Ivan Levkivskyi d111490a1f
[3.7] bpo-36679: Rename duplicate test_class_getitem function (GH-12892) (GH-12978)
(cherry picked from commit d437012cdd)

Co-authored-by: Windson yang <wiwindson@outlook.com>
2019-04-26 18:21:45 -07:00
Victor Stinner 1069d38fa1
[3.7] bpo-36719: sync regrtest with master branch (GH-12967)
* Clean up code which checked presence of os.{stat,lstat,chmod} (GH-11643)

(cherry picked from commit 8377cd4fcd)

* bpo-36725: regrtest: add TestResult type (GH-12960)

* Add TestResult and MultiprocessResult types to ensure that results
  always have the same fields.
* runtest() now handles KeyboardInterrupt
* accumulate_result() and format_test_result() now takes a TestResult
* cleanup_test_droppings() is now called by runtest() and mark the
  test as ENV_CHANGED if the test leaks support.TESTFN file.
* runtest() now includes code "around" the test in the test timing
* Add print_warning() in test.libregrtest.utils to standardize how
  libregrtest logs warnings to ease parsing the test output.
* support.unload() is now called with abstest rather than test_name
* Rename 'test' variable/parameter to 'test_name'
* dash_R(): remove unused the_module parameter
* Remove unused imports

(cherry picked from commit 4d29983185)

* bpo-36725: Refactor regrtest multiprocessing code (GH-12961)

Rewrite run_tests_multiprocess() function as a new MultiprocessRunner
class with multiple methods to better report errors and stop
immediately when needed.

Changes:

* Worker processes are now killed immediately if tests are
  interrupted or if a test does crash (CHILD_ERROR): worker
  processes are killed.
* Rewrite how errors in a worker thread are reported to
  the main thread. No longer ignore BaseException or parsing errors
  silently.
* Remove 'finished' variable: use worker.is_alive() instead
* Always compute omitted tests. Add Regrtest.get_executed() method.

(cherry picked from commit 3cde440f20)

* bpo-36719: regrtest always detect uncollectable objects (GH-12951)

regrtest now always detects uncollectable objects. Previously, the
check was only enabled by --findleaks. The check now also works with
-jN/--multiprocess N.

--findleaks becomes a deprecated alias to --fail-env-changed.

(cherry picked from commit 75120d2205)

* bpo-34060: Report system load when running test suite for Windows (GH-8357)

While Windows exposes the system processor queue length, the raw value
used for load calculations on Unix systems, it does not provide an API
to access the averaged value. Hence to calculate the load we must track
and average it ourselves. We can't use multiprocessing or a thread to
read it in the background while the tests run since using those would
conflict with test_multiprocessing and test_xxsubprocess.

Thus, we use Window's asynchronous IO API to run the tracker in the
background with it sampling at the correct rate. When we wish to access
the load we check to see if there's new data on the stream, if there is,
we update our load values.


(cherry picked from commit e16467af0b)

* bpo-36719: Fix regrtest re-run (GH-12964)

Properly handle a test which fail but then pass.

Add test_rerun_success() unit test.

(cherry picked from commit 837acc1957)

* bpo-36719: regrtest closes explicitly WindowsLoadTracker (GH-12965)

Regrtest.finalize() now closes explicitly the WindowsLoadTracker
instance.

(cherry picked from commit 00db7c73af)
2019-04-26 12:16:30 +02:00
Miss Islington (bot) 3076a3e0d1 bpo-28552: Fix distutils.sysconfig for empty sys.executable (GH-12875) (GH-12948)
bpo-28552, bpo-7774: Fix distutils.sysconfig if sys.executable is
None or an empty string: use os.getcwd() to initialize project_base.

Fix also the distutils build command: don't use sys.executable if
it's evaluated as false (None or empty string).
(cherry picked from commit 0ef8c157e9)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2019-04-25 13:15:47 +02:00
Miss Islington (bot) e1a6cf2824
bpo-36454: Fix test_time.test_monotonic() (GH-12929)
Change test_time.test_monotonic() to test only the lower bound of elapsed time
after a sleep command rather than the upper bound. This prevents unnecessary
test failures on slow buildbots. Patch by Victor Stinner.
(cherry picked from commit d246a6766b)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2019-04-23 15:35:55 -07:00
Miss Islington (bot) 9344d74f7b
Fixes platform.win32_ver on non-Windows platforms (GH-12912)
(cherry picked from commit d307d05350)

Co-authored-by: Steve Dower <steve.dower@microsoft.com>
2019-04-22 11:59:08 -07:00
Marcin Niemira 1100ae8f3f bpo-36523: Add docstring to io.IOBase.writelines (GH-12683)
(cherry picked from commit ab86521a9d)
2019-04-22 21:08:24 +09:00
Berker Peksag 15a57a3cad
bpo-23078: Add support for {class,static}method to mock.create_autospec() (GH-11613)
Co-authored-by: Felipe <felipe.nospam.ochoa@gmail.com>

(cherry picked from commit 9b21856b0f)
2019-04-22 06:07:56 +03:00
Miss Islington (bot) 8b30ee8435 bpo-36650: Fix handling of empty keyword args in C version of lru_cache. (GH-12881) (GH-12888)
(cherry picked from commit 14adbd4598)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
2019-04-20 07:50:32 -10:00
Victor Stinner 394b991e41
[3.7] bpo-35755: shutil.which() uses os.confstr("CS_PATH") (GH-12862)
* bpo-35755: shutil.which() uses os.confstr("CS_PATH") (GH-12858)

shutil.which() and distutils.spawn.find_executable() now use
os.confstr("CS_PATH") if available instead of os.defpath, if the PATH
environment variable is not set.

Don't use os.confstr("CS_PATH") nor os.defpath if the PATH
environment variable is set to an empty string.

Changes:

* find_executable() now starts by checking for the executable in the
  current working directly case. Add an explicit
  "if not path: return None".
* Add tests for PATH='' (empty string), PATH=':' and for PATHEXT.

(cherry picked from commit 228a3c99bd)

* bpo-35755: Remove current directory from posixpath.defpath (GH-11586)

Document the change in a NEWS entry of the Security category.

(cherry picked from commit 2c4c02f8a8)
2019-04-17 18:38:06 +02:00
Victor Stinner 2815bf5b1f
bpo-36348: test_imaplib: add debug info (GH-12846)
Log more info if tests fail.
2019-04-15 18:45:01 +02:00
Miss Islington (bot) 28ed39e83e bpo-36629: Add support.get_socket_conn_refused_errs() (GH-12834) (GH-12835)
Fix test_imap4_host_default_value() of test_imaplib: catch also
errno.ENETUNREACH error.
(cherry picked from commit 3c7931e514)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2019-04-15 12:49:37 +02:00
Miss Islington (bot) 9f9e029bd2
bpo-16079: fix duplicate test method name in test_gzip. (GH-12827)
(cherry picked from commit cd466559c4)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2019-04-14 10:50:52 -07:00
Miss Islington (bot) f3a9d722d7
bpo-36593: Fix isinstance check for Mock objects with spec executed under tracing (GH-12790)
In Python having a trace function in effect while mock is imported causes isinstance to be wrong for MagicMocks. This is due to the usage of super() in some class methods, as this sets the __class__ attribute. To avoid this, as a workaround, alias the usage of super .
(cherry picked from commit 830b43d03c)

Co-authored-by: Xtreak <tir.karthi@gmail.com>
2019-04-13 12:31:58 -07:00
Miss Islington (bot) d28aaa7df8
Skip test_preadv_flags if RWF_HIPRI is not supported by the system (GH-12762)
(cherry picked from commit 46544f69bf)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2019-04-13 09:25:20 -07:00
Miss Islington (bot) 7182e653fb
bpo-36611: Fix test_sys.test_getallocatedblocks() (GH-12797)
Fix test_sys.test_getallocatedblocks() when tracemalloc is enabled.
If the name of Python memory allocators cannot get read, consider
that pymalloc is disabled.

Fix the following error:

./python -X tracemalloc -m test test_sys -v -m test_getallocatedblocks

ERROR: test_getallocatedblocks (test.test_sys.SysModuleTest)
------------------------------------------------------------
Traceback (most recent call last):
  File "Lib/test/test_sys.py", line 770, in test_getallocatedblocks
    alloc_name = _testcapi.pymem_getallocatorsname()
RuntimeError: cannot get allocators name
(cherry picked from commit 9b8314cfe2)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2019-04-12 06:33:31 -07:00
Victor Stinner 9e23f0a27c
[3.7] bpo-36389: _PyObject_IsFreed() now also detects uninitialized memory (GH-12770) (GH-12788)
* bpo-36389: _PyObject_IsFreed() now also detects uninitialized memory (GH-12770)

Replace _PyMem_IsFreed() function with _PyMem_IsPtrFreed() inline
function. The function is now way more efficient, it became a simple
comparison on integers, rather than a short loop. It detects also
uninitialized bytes and "forbidden bytes" filled by debug hooks
on memory allocators.

Add unit tests on _PyObject_IsFreed().

(cherry picked from commit 2b00db6855)

* bpo-36389: Change PyMem_SetupDebugHooks() constants (GH-12782)

Modify CLEANBYTE, DEADDYTE and FORBIDDENBYTE constants: use 0xCD,
0xDD and 0xFD, rather than 0xCB, 0xBB and 0xFB, to use the same byte
patterns than Windows CRT debug malloc() and free().

(cherry picked from commit 4c409beb4c)
2019-04-11 22:30:31 +02:00
Miss Islington (bot) d9b25a2627
bpo-36235: Fix distutils test_customize_compiler() on macOS (GH-12764)
Set CUSTOMIZED_OSX_COMPILER to True to disable
_osx_support.customize_compiler().
(cherry picked from commit a9bd8925c7)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2019-04-10 16:58:55 -07:00
Miss Islington (bot) 796698adf5
bpo-12910: update and correct quote docstring (GH-2568)
Fixes some mistakes and misleadings in the quote function docstring:
- reserved chars are never actually used by quote code, unreserved chars are
- reserved chars were wrong and incomplete
- mentioned that use-case is not minimal quoting wrt. RFC, but cautious quoting
(cherry picked from commit 750d74fac5)

Co-authored-by: Jörn Hees <joernhees@users.noreply.github.com>
2019-04-09 17:53:03 -07:00
Victor Stinner 86f0354fcb
[3.7] bpo-36560: regrtest: don't collect the GC twice (GH-12747) (GH-12749)
* bpo-36560: Fix reference leak hunting in regrtest (GH-12744)

Fix reference leak hunting in regrtest: compute also deltas (of
reference count, allocated memory blocks, file descriptor count)
during warmup, to ensure that everything is initialized before
starting to hunt reference leaks.

Other changes:

* Replace gc.collect() with support.gc_collect()
* Move calls to read memory statistics from dash_R_cleanup() to
  dash_R()
* Pass regrtest 'ns' to dash_R()
* dash_R() is now more quiet with --quiet option (don't display
  progress).
* Precompute the full range for "for it in range(repcount):" to
  ensure that the iteration doesn't allocate anything new.
* dash_R() now is responsible to call warm_caches().

(cherry picked from commit 5aaac94eeb)

* bpo-36560: regrtest: don't collect the GC twice (GH-12747)

dash_R() function of libregrtest doesn't call support.gc_collect()
directly anymore: it's already called by dash_R_cleanup().

Call dash_R_cleanup() before starting the loop.

(cherry picked from commit bb4447897a)
2019-04-09 18:55:50 +02:00
Miss Islington (bot) 0a16bb15af
closes bpo-35848: Move all documentation regarding the readinto out of IOBase. (GH-11893)
Move all documentation regarding the readinto method into either io.RawIOBase or io.BufferedIOBase.

Corresponding changes to documentation in the _pyio.py module.
(cherry picked from commit 7b97ab35b2)

Co-authored-by: Steve Palmer <steve@srpalmer.me.uk>
2019-04-08 21:57:31 -07:00
Miss Islington (bot) 2368d86ed1 bpo-36565: Fix libregrtest for Python without builtin _abc (GH-12733) (GH-12734)
Fix reference hunting (``python3 -m test -R 3:3``) when Python has no
built-in abc module: fix _get_dump() reimplementation of libregrtest.
(cherry picked from commit 79b5d29041)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2019-04-09 01:54:16 +02:00
Miss Islington (bot) 6f9cd142a2 bpo-36522: Print all values for headers with multiple values. (GH-12681) (GH-12682)
(cherry picked from commit 461c416dd7)

Co-authored-by: Matt Houglum <houglum@google.com>
2019-04-04 11:25:59 +03:00
Pablo Galindo 513d142993
[3.7] bpo-36440: include node names in ParserError messages, instead of numeric IDs (GH-12565) (GH-12671)
The error messages in the parser module are referring to numeric IDs for the nodes. To improve readability, use the node names when reporting errors..
(cherry picked from commit cb0748d393)

Co-authored-by: tyomitch <tyomitch@gmail.com>
2019-04-03 14:34:59 -04:00
Miss Islington (bot) 9c08eeb30c
bpo-36504: Fix signed integer overflow in _ctypes.c's PyCArrayType_new(). (GH-12660)
(cherry picked from commit 487b73ab39)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2019-04-03 10:55:26 -07:00
Miss Islington (bot) 5ca4fe0478
bpo-13120: fix typo with test_issue13120() method name (GH-12250)
Incorrect issue number '13210' added in 539ee5da6f.

https://bugs.python.org/issue13120
(cherry picked from commit 9139f926a8)

Co-authored-by: Daniel Hahler <github@thequod.de>
2019-04-02 01:17:25 -07:00
Inada Naoki 8384670615
bpo-20844: open script file with "rb" mode (GH-12616)
(cherry picked from commit 10654c19b5)
2019-04-01 21:02:51 +09:00
Serhiy Storchaka a37f356de1
[3.7] bpo-36492: Fix passing special keyword arguments to some functions. (GH-12637) (GH-12645)
The following arguments can be passed as keyword arguments for passing
to other function if the corresponding required argument is passed as
positional:

- "func" in functools.partialmethod(), weakref.finalize(),
  profile.Profile.runcall(), cProfile.Profile.runcall(),
  bdb.Bdb.runcall(), trace.Trace.runfunc() and
  curses.wrapper().
- "function" in unittest.addModuleCleanup() and
  unittest.TestCase.addCleanup().
- "fn" in the submit() method of concurrent.futures.ThreadPoolExecutor
  and concurrent.futures.ProcessPoolExecutor.
- "callback" in contextlib.ExitStack.callback(),
  contextlib.AsyncExitStack.callback() and
  contextlib.AsyncExitStack.push_async_callback().
- "c" and "typeid" in multiprocessing.managers.Server.create().
- "obj" in weakref.finalize().

(cherry picked from commit 42a139ed88)
2019-04-01 10:59:24 +03:00
Miss Islington (bot) bd48280cb6 bpo-24214: Fixed the UTF-8 incremental decoder. (GH-12603) (GH-12627)
The bug occurred when the encoded surrogate character is passed
to the incremental decoder in two chunks.
(cherry picked from commit 7a465cb5ee)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2019-03-30 15:52:41 +02:00
Miss Islington (bot) 4724ba9b57 bpo-36434: Properly handle writing errors in ZIP files. (GH-12559) (GH-12628)
Errors during writing no longer prevent to properly close
the ZIP file.
(cherry picked from commit 2524fdefc9)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2019-03-30 15:52:16 +02:00
Miss Islington (bot) 9cad523328
bpo-31292: Fixed distutils check --restructuredtext for include directives (GH-10605)
(cherry picked from commit d5a5a33f12)

Co-authored-by: Philipp A <flying-sheep@web.de>
2019-03-27 15:25:57 -07:00
Miss Islington (bot) 65445f65e6
bpo-36441: Fixes creating a venv when debug binaries are installed. (GH-12566)
(cherry picked from commit 4a9a505d6f)

Co-authored-by: Steve Dower <steve.dower@microsoft.com>
2019-03-27 08:47:57 -07:00
Miss Islington (bot) 23eb816399
bpo-36429: Fix starting IDLE with pyshell (GH-12548)
Add idlelib.pyshell alias at top; remove pyshell alias at bottom.
Remove obsolete __name__=='__main__' command.
(cherry picked from commit 6a258c8890)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2019-03-26 17:19:23 -07:00
Miss Islington (bot) 03440850e7
bpo-36433: fix confusing error messages in classmethoddescr_call (GH-12556)
https://bugs.python.org/issue36433
(cherry picked from commit 871309c775)

Co-authored-by: Inada Naoki <songofacandy@gmail.com>
2019-03-26 02:47:08 -07:00
Miss Islington (bot) 9dbb09fc27 bpo-36218: Fix handling of heterogeneous values in list.sort (GH-12209) GH-12532)
(cherry picked from commit dd5417afcf)

Co-authored-by: Rémi Lapeyre <remi.lapeyre@henki.fr>
2019-03-25 00:47:55 -07:00
Miss Islington (bot) 0e05d8a82d
bpo-30348: IDLE: Add test_autocomplete unittest (GH-2209)
(cherry picked from commit 113d735e20)

Co-authored-by: Louie Lu <git@louie.lu>
2019-03-24 16:53:13 -07:00
Miss Islington (bot) 2b580146a5
bpo-36405: IDLE - Restore __main__ and add tests (GH-12518)
Fix error in commit 2b75155 noticed by Serhiy Storchaka.
(cherry picked from commit 0fe4513d9a)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2019-03-24 14:32:40 -07:00
Miss Islington (bot) 5ab665005b
bpo-23205: IDLE: Add tests and refactor grep's findfiles (GH-12203)
* Add tests for grep findfiles.
* Move findfiles to module function.
* Change findfiles to use os.walk.

Based on a patch by Al Sweigart.
(cherry picked from commit d60f658fc0)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
2019-03-23 05:21:46 -07:00
Miss Islington (bot) 00986ec553
bpo-36405: Use dict unpacking in idlelib (GH-12507)
Remove now unneeded imports.
(cherry picked from commit 2b75155590)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2019-03-23 01:08:37 -07:00
Miss Islington (bot) 2d7798ad12
bpo-36396: Remove fgBg param of idlelib.config.GetHighlight() (GH-12491)
This param was only used once and changed the return type.
(cherry picked from commit c1419578a1)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2019-03-22 15:42:51 -07:00
Miss Islington (bot) fdd82338a3
Raise the timeout in test_multiprocessing_* for slow buildbots (GH-12489)
(cherry picked from commit 40b6907b37)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2019-03-22 00:54:32 -07:00
Miss Islington (bot) 00eb97b4a7 bpo-36256: Fix bug in parsermodule when parsing if statements (GH-12488)
bpo-36256: Fix bug in parsermodule when parsing if statements

In the parser module, when validating nodes before starting the parsing with to create a ST in "parser_newstobject" there is a problem that appears when two arcs in the same DFA state has transitions with labels with the same type. For example, the DFA for if_stmt has a state with
two labels with the same type: "elif" and "else" (type NAME). The algorithm tries one by one the arcs until the label that starts the arc transition has a label with the same type of the current child label we are trying to accept. In this case, the arc for "elif" comes before the arc for "else"and passes this test (because the current child label is "else" and has the same type as "elif"). This lead to expecting a namedexpr_test (305) instead of a colon (11). The solution is to compare also the string representation (in case there is one) of the labels to see if the transition that we have is the correct one.
(cherry picked from commit 9a0000d15d)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2019-03-21 23:56:20 +00:00
Miss Islington (bot) b0967fe4ed
bpo-35978: Correctly skips venv tests in venvs (GH-12220)
Also fixes venvs from the build directory on Windows.
(cherry picked from commit 8bba81fd55)

Co-authored-by: Steve Dower <steve.dower@microsoft.com>
2019-03-21 10:33:40 -07:00
Miss Islington (bot) 74829b7323
bpo-36312: Fix decoders for some code pages. (GH-12369)
(cherry picked from commit c1e2c288f4)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2019-03-20 21:31:57 -07:00
Victor Stinner dd1cfefd67
bpo-36235: Enhance distutils test_customize_compiler() (GH-12403) (GH-12415)
The test test_customize_compiler() now mocks all sysconfig variables
and all environment variables used by customize_compiler().

(cherry picked from commit 72c7b372cf)
2019-03-18 18:34:11 +01:00
Miss Islington (bot) 6a7a9f1d83 bpo-36272: Logging now propagates RecursionError (GH-12312) (GH-12391)
(cherry picked from commit 65f64b1903)

Co-authored-by: Rémi Lapeyre <remi.lapeyre@henki.fr>
2019-03-18 14:22:41 +00:00
Miss Islington (bot) bedfbc790e bpo-36321: Fix misspelled attribute in namedtuple() (GH-12375) (GH-12395)
(cherry picked from commit 23581c018f)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
2019-03-18 00:48:02 -07:00
Miss Islington (bot) 7f7485c060
bpo-34745: Fix asyncio sslproto memory issues (GH-12386)
* Fix handshake timeout leak in asyncio/sslproto

Refs MagicStack/uvloopGH-222

* Break circular ref _SSLPipe <-> SSLProtocol

* bpo-34745: Fix asyncio ssl memory leak

* Break circular ref SSLProtocol <-> UserProtocol

* Add NEWS entry
(cherry picked from commit f683f46425)

Co-authored-by: Fantix King <fantix.king@gmail.com>
2019-03-17 16:09:14 -07:00
Miss Islington (bot) b34f1aa814
bpo-23216: IDLE: Add docstrings to search modules (GH-12141)
(cherry picked from commit 0bb5e75cf8)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
2019-03-16 16:47:28 -07:00
Victor Stinner 6c0e0d141a
bpo-36235: Fix CFLAGS in distutils customize_compiler() (GH-12236) (GH-12348)
Fix CFLAGS in customize_compiler() of distutils.sysconfig: when the
CFLAGS environment variable is defined, don't override CFLAGS variable with
the OPT variable anymore.

Initial patch written by David Malcolm.

Co-Authored-By: David Malcolm <dmalcolm@redhat.com>
(cherry picked from commit 86082c22d2)
2019-03-15 16:03:50 +01:00
Miss Islington (bot) 0b9bd5b4c3
Fix typo duplicate period in a docstring in the zipfile module. (GH-12326)
(cherry picked from commit 53c2935dac)

Co-authored-by: nick sung <sungboss2004@gmail.com>
2019-03-14 21:52:59 -07:00
Ned Deily 69785b2127 3.7.3rc1 2019-03-12 15:14:21 -04:00
Miss Islington (bot) 1c4580d1f5
[3.7] bpo-35931: Gracefully handle any exception in pdb debug command (GH-12103) (GH-12285)
This is relevant for `debug doesnotexist()`, which would crash with a
NameError otherwise.
(cherry picked from commit 3e936431e2)


Co-authored-by: Daniel Hahler <github@thequod.de>


https://bugs.python.org/issue35931
2019-03-11 21:00:59 -07:00
Miss Islington (bot) 24872e1e15
bpo-36234: Add more tests to PosixUidGidTests (GH-12234)
test_posix.PosixUidGidTests:

* Add tests for invalid uid/gid type (str)
* Add UID_OVERFLOW and GID_OVERFLOW constants to replace (1 << 32)

Initial patch written by David Malcolm.

Co-Authored-By: David Malcolm <dmalcolm@redhat.com>
(cherry picked from commit 876e82b4f3)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2019-03-11 06:18:40 -07:00
Miss Islington (bot) ea1627008e
bpo-36176: Fix IDLE autocomplete & calltip popup colors. (GH-12262)
Prevent conflicts with Linux dark themes
(and slightly darken calltip background).
(cherry picked from commit 491ef53c15)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2019-03-10 17:37:36 -07:00
Miss Islington (bot) 97c7d78fda
bpo-35647: Fix path check in cookiejar (GH-11436)
* Refactor cookie path check as per RFC 6265

* Add tests for prefix match of path

* Add news entry

* Fix set_ok_path and refactor tests

* Use slice for last letter
(cherry picked from commit 0e1f1f0105)

Co-authored-by: Xtreak <tir.karthi@gmail.com>
2019-03-10 10:30:35 -07:00
Miss Islington (bot) e5123d81ff bpo-35121: prefix dot in domain for proper subdomain validation (GH-10258) (GH-12261)
Don't send cookies of domain A without Domain attribute to domain B when domain A is a suffix match of domain B while using a cookiejar with `http.cookiejar.DefaultCookiePolicy` policy.  Patch by Karthikeyan Singaravelan.
(cherry picked from commit ca7fe50635)

Co-authored-by: Xtreak <tir.karthi@gmail.com>
2019-03-09 21:58:25 -05:00
Miss Islington (bot) 4e2079d896
Fix typos and improve grammar in threading.Barrier docstrings (GH-12210)
(cherry picked from commit 62fa51f121)

Co-authored-by: Carl Bordum Hansen <carl@bordum.dk>
2019-03-09 09:56:40 -08:00
Miss Islington (bot) 572205adf0
bpo-35807: Upgrade ensurepip bundled pip and setuptools (GH-12189)
* Update pip to 19.0.3
* Update setuptools to 40.8.0
(cherry picked from commit 01e0f439f5)

Co-authored-by: Pradyun Gedam <pradyunsg@gmail.com>
2019-03-08 13:44:39 -08:00
Miss Islington (bot) 8755f0aeb6
bpo-35899: Fix Enum handling of empty and weird strings (GH-11891)
Co-authored-by: Maxwell <maxwellpxt@gmail.com>
Co-authored-by: Stéphane Wirtel <stephane@wirtel.be>

https://bugs.python.org/issue35899
(cherry picked from commit 8b914d2767)

Co-authored-by: Brennan D Baraban <34765317+bdbaraban@users.noreply.github.com>
2019-03-08 13:44:21 -08:00
Miss Islington (bot) 02351ed1ba
bpo-34162: Add entries for idlelib/NEWS.txt (GH-12232)
(cherry picked from commit 8a1bab9291)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2019-03-08 00:25:52 -08:00
Steve Dower daad2c482c
bpo-36216: Add check for characters in netloc that normalize to separators (GH-12201) 2019-03-07 09:08:18 -08:00
Victor Stinner 279657bac2
[3.7] bpo-29571: Fix test_re.test_locale_flag() (GH-12178)
Use locale.getpreferredencoding() rather than locale.getlocale() to
get the locale encoding. With some locales, locale.getlocale()
returns the wrong encoding.

For example, on Fedora 29, locale.getlocale() returns ISO-8859-1
encoding for the "en_IN" locale, whereas
locale.getpreferredencoding() reports the correct encoding: UTF-8.

On Windows, set temporarily the LC_CTYPE locale to the user preferred
encoding to ensure that it uses the ANSI code page, to be consistent
with locale.getpreferredencoding().
2019-03-05 16:17:43 +01:00
Miss Islington (bot) 06e9953d5e
bpo-35198 Fix C++ extension compilation on AIX (GH-10437)
For C++ extensions, distutils tries to replace the C compiler with the
C++ compiler, but it assumes that C compiler is the first element after
any environment variables set. On AIX, linking goes through ld_so_aix,
so it is the first element and the compiler is the next element. Thus
the replacement is faulty:

ld_so_aix gcc ... -> g++ gcc ...

Also, it assumed that self.compiler_cxx had only 1 element or that
there were the same number of elements as the linker has and in the
same order. This might not be the case, so instead concatenate
everything together.
(cherry picked from commit 800d5cd750)

Co-authored-by: Kevin Adler <kadler@us.ibm.com>
2019-03-04 07:06:36 -08:00
Miss Islington (bot) f780443399
fixed duplicated method name of test_getuserbase() (GH-12140)
(cherry picked from commit 45d8d2469a)

Co-authored-by: native-api <ivan_pozdeev@mail.ru>
2019-03-03 15:09:10 -08:00
Miss Islington (bot) 4b9459d3a3 Autospec functions should propagate mock calls to parent GH-11273 (#12039)
(cherry picked from commit 9c3f284de5)

Co-authored-by: Xtreak <tir.karthi@gmail.com>
2019-03-03 17:14:44 +00:00
Miss Islington (bot) cd0416466f
bpo-36091: Remove reference to async generator in Lib/types.py. (GH-11996)
(cherry picked from commit 0a6a412fb2)

Co-authored-by: Henry Chen <tahafut@gmail.com>
2019-03-03 06:54:39 -08:00
Miss Islington (bot) 243b2064ce
bpo-32129: Avoid blurry IDLE application icon on macOS with Tk 8.6. (GH-12031)
Patch by Kevin Walzer.
(cherry picked from commit 7eebbbd5b3)

Co-authored-by: Ned Deily <nad@python.org>
2019-03-01 15:13:57 -08:00
Miss Islington (bot) b94874f7e2
bpo-35178: Fix warnings._formatwarnmsg() (GH-12033)
Ensure custom formatwarning function can receive line as positional argument.

Co-Authored-By: Tashrif Billah <tashrifbillah@gmail.com>
(cherry picked from commit be7c460fb5)

Co-authored-by: Xtreak <tir.karthi@gmail.com>
2019-03-01 09:40:10 -08:00
Miss Islington (bot) 70852b1eb6
bpo-36152: IDLE: Remove unused parameter from colorizer (GH-12109)
Remove colorizer.ColorDelegator.close_when_done and the corresponding argument of .close().  In IDLE, both have always been None or False since 2007.
(cherry picked from commit b9f0354efc)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
2019-03-01 02:43:43 -08:00
Miss Islington (bot) 488aabafe2 bpo-36096: IDLE: Refactor class variables in colorizer (GH-12002) (GH-12075)
(cherry picked from commit ed1deb0719)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
2019-02-27 14:14:06 -05:00
Miss Islington (bot) 2632474957
bpo-36123: Fix test_socket.testWithTimeoutTriggeredSend() race condition (GH-12053)
Use longer timeout for accept() in the server and block on accept in the client.
The client now only sets the timeout once the socket is connected.
(cherry picked from commit 53b9e1a1c1)

Co-authored-by: Joannah Nanjekye <33177550+nanjekyejoannah@users.noreply.github.com>
2019-02-26 08:48:52 -08:00
Miss Islington (bot) ea199b90bb bpo-35512: Resolve string target to patch.dict decorator during function call GHGH-12000 (#12021)
* Resolve string target to patch.dict during function call

* Add NEWS entry

* Remove unneeded call

* Restore original value for support.target and refactor assertions

* Add extra assertion to verify unpatched dict
(cherry picked from commit a875ea58b2)

Co-authored-by: Xtreak <tir.karthi@gmail.com>
2019-02-25 21:17:16 +00:00
Miss Islington (bot) 25d20a6503
bpo-27313: Avoid test_ttk_guionly ComboboxTest fail with macOS Cocoa Tk (GH-12011)
(cherry picked from commit aeca373b33)

Co-authored-by: Ned Deily <nad@python.org>
2019-02-23 23:46:20 -08:00
Miss Islington (bot) 38aea4131f
bpo-24310: Document IDLE settings dialog font tab sample (GH-12007)
(cherry picked from commit d610116a2e)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2019-02-23 20:23:08 -08:00
Miss Islington (bot) 6163210089
bpo-36019: Use pythontest.net instead of example.com in network tests (GH-11941)
(cherry picked from commit a40681dd5d)

Co-authored-by: Stéphane Wirtel <stephane@wirtel.be>
2019-02-22 06:03:26 -08:00
Miss Islington (bot) 7121a6eeb7 bpo-36060: Document how collections.ChainMap() determines iteration order (GH-11969) (GH-11978)
(cherry picked from commit 86f093f71a)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
2019-02-21 09:47:46 -08:00
Miss Islington (bot) e8bf04de4b
bpo-36037: Fix test_ssl for strict OpenSSL policy (GH-11940)
Fix test_ssl for strict OpenSSL configuration like RHEL8 strict crypto policy.
Use older TLS version for minimum TLS version of the server SSL context if
needed, to test TLS version older than default minimum TLS version.
(cherry picked from commit 3ef6344ee5)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2019-02-19 09:24:16 -08:00