Commit Graph

43125 Commits

Author SHA1 Message Date
Miss Islington (bot) af1d007bdb
test.regrtest: flush stdout when display progress (GH-7105)
runtest_mp.py: call print() with flush=True.
(cherry picked from commit 4f0bc7f7ab)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2018-05-25 09:46:33 -07:00
Miss Islington (bot) d9eb22c67c
bpo-33629: Prevent coredump in test_importlib (GH-7090)
bpo-32374, bpo-33629: Use support.SuppressCrashReport() in
test_bad_traverse() of MultiPhaseExtensionModuleTests to prevent
leaking a core dump file.
(cherry picked from commit 483000e164)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2018-05-24 13:44:56 -07:00
Miss Islington (bot) b2ab5dc72b
bpo-33628: IDLE: Minor code cleanup of codecontext.py and its tests (GH-7085)
(cherry picked from commit 8506016f90)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
2018-05-23 20:26:54 -07:00
Miss Islington (bot) dd7a255911 bpo-33109: argparse subparsers are once again not required by default (GH-6919) (GH-7089)
bpo-26510 in 3.7.0a2 changed the behavior of argparse to make
subparsers required by default, returning to the behavior of 2.7
and 3.2. The behavior was changed in 3.3 to be no longer required.
While it might make more sense to have the default to required,
compatibility with 3.3 through 3.6 is probably less disruptive
than trying to reintroduce compatibility with 2.7 at this point.
This change restores the 3.6 behavior.
(cherry picked from commit 8ebf5ceb0f)

Co-authored-by: Ned Deily <nad@python.org>
2018-05-23 22:22:46 -04:00
Miss Islington (bot) fa286edbde
bpo-33540: Add block_on_close attr to socketserver (GH-6911)
Add a new block_on_close class attribute to ForkingMixIn and
ThreadingMixIn classes of socketserver to opt-in for pre-3.7 behaviour.
(cherry picked from commit 453bd0bc65)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2018-05-23 18:34:43 -07:00
Victor Stinner fa24c1c5af
[3.7] bpo-33353: Fix test_asyncio on FreeBSD (GH-7087)
* bpo-33353: test_asyncio uses smaller sendfile data (#7083)

bpo-32622, bpo-33353: sendfile() tests of test_asyncio use socket
buffers of 1 kB "to test on relative small data sets". Send only
160 KiB rather 10 MB to make the test much faster.

Shrink also SendfileBase.DATA from 1600 KiB to 160 KiB.

On Linux, 3 test_sock_sendfile_mix_with_regular_send() runs now take
less than 1 second, instead of 18 seconds.

On FreeBSD, the 3 tests didn't hang, but took 3 minutes. Now
the 3 tests pass in less than 1 seconds.

(cherry picked from commit 2932755cc1)

* bpo-33353: test_asyncio set SO_SNDBUF after connect (GH-7086)

bpo-32622, bpo-33353: On macOS, sock.connect() changes the
SO_SNDBUF value. Only set SO_SNDBUF and SO_RCVBUF buffer sizes
once a socket is connected or binded, not before.

(cherry picked from commit b97de3dd86)
2018-05-24 03:21:14 +02:00
Miss Islington (bot) 72ef4fc32b [3.7] bpo-33618: Enable TLS 1.3 in tests (GH-7079) (GH-7082)
TLS 1.3 behaves slightly different than TLS 1.2. Session tickets and TLS
client cert auth are now handled after the initialy handshake. Tests now
either send/recv data to trigger session and client certs. Or tests
ignore ConnectionResetError / BrokenPipeError on the server side to
handle clients that force-close the socket fd.

To test TLS 1.3, OpenSSL 1.1.1-pre7-dev (git master + OpenSSL PR
https://github.com/openssl/openssl/pull/6340) is required.

Signed-off-by: Christian Heimes <christian@python.org>
(cherry picked from commit 529525fb5a)
2018-05-23 22:49:04 +02:00
Miss Islington (bot) 0f9b68a728
Reverse the meaning of is_argument when used for type check (GH-7039)
(cherry picked from commit 0e61dffdba)

Co-authored-by: Nina Zakharenko <nzakharenko@gmail.com>
2018-05-22 20:51:15 -07:00
Miss Islington (bot) 2751dccca4
bpo-33604: Remove Pending from hmac Deprecation warning. (GH-7062)
bpo-33604: Bump removal notice from 3.6 to 3.8 and change PendingDeprecationWarning to DeprecationWarning as we had intended to do earlier...
(cherry picked from commit 8bb0b5b03c)

Co-authored-by: Matthias Bussonnier <bussonniermatthias@gmail.com>
2018-05-22 16:40:44 -07:00
Miss Islington (bot) cd57b48ef9
bpo-33570: TLS 1.3 ciphers for OpenSSL 1.1.1 (GH-6976)
Change TLS 1.3 cipher suite settings for compatibility with OpenSSL
1.1.1-pre6 and newer. OpenSSL 1.1.1 will have TLS 1.3 cipers enabled by
default.

Also update multissltests and Travis config to test with latest OpenSSL.

Signed-off-by: Christian Heimes <christian@python.org>
(cherry picked from commit e8eb6cb792)

Co-authored-by: Christian Heimes <christian@python.org>
2018-05-22 14:40:46 -07:00
Miss Islington (bot) ca6d7aee91
Improve comments in test_idle.py. (GH-7057)
(cherry picked from commit 2a6d5da1d3)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2018-05-22 10:43:55 -07:00
Miss Islington (bot) 25fd6cc5b0
bpo-30877: Fix clearing a cache in the the JSON decoder. (GH-7048)
(cherry picked from commit ae00fb1d4f)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-05-22 06:03:10 -07:00
Miss Islington (bot) 316f86911a
Use IPv4 only to avoid IP address collision (GH-7030)
(cherry picked from commit b7555babe9)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
2018-05-21 05:30:06 -07:00
Miss Islington (bot) 4d39ade62a Fix asyncio flaky tests (GH-7023) (#7024)
(cherry picked from commit e253752191)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
2018-05-21 14:47:29 +03:00
Miss Islington (bot) b8b800090f bpo-33263: Fix FD leak in _SelectorSocketTransport (GH-6450) (#7022)
* bpo-33263 Fix FD leak in _SelectorSocketTransport. (GH-6450)

Under particular circumstances _SelectorSocketTransport can try to add a reader
even the transport is already being closed. This can lead to FD leak and
invalid stated of the following connections. Fixed the SelectorSocketTransport
to add the reader only if the trasport is still active.
(cherry picked from commit a84d0b361a)

Co-authored-by: Vlad Starostin <drtyrsa@yandex.ru>
2018-05-21 11:35:25 +03:00
Miss Islington (bot) b85115ed4c [3.7] bpo-32262: Fix typo in f-string (GH-7016)
Fix typo from commit 6370f345e1

(cherry picked from commit d361e99868)
Co-authored-by: Christian Heimes <christian@python.org>
2018-05-20 20:22:50 +02:00
Miss Islington (bot) 073eca39a5
bpo-33542: Ignore DUID in uuid.get_node on Windows. (GH-6922)
uuid._ipconfig_getnode did not validate the maximum length of the value,
so long as the value had the same type of formatting as a MAC address.
This let it select DUIDs as MAC addresses. It now requires an exact
length match.
(cherry picked from commit c66c342cb4)

Co-authored-by: CtrlZvi <viz+github@flippedperspective.com>
2018-05-20 08:40:10 -07:00
Serhiy Storchaka b32f8897ea
[3.7] bpo-33475: Fix and improve converting annotations to strings. (GH-6774). (GH-6927)
(cherry picked from commit 64fddc423f)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-05-20 18:06:08 +03:00
Miss Islington (bot) 52d1741c95 bpo-33584: Fix several minor bugs in asyncio. (GH-7003) (GH-7005)
Fix the following bugs in the C implementation:

* get_future_loop() silenced all exceptions raised when look up the get_loop
  attribute, not just an AttributeError.
* enter_task() silenced all exceptions raised when look up the current task,
  not just a KeyError.
* repr() was called for a borrowed link in enter_task() and task_step_impl().
* str() was used instead of repr() in formatting one error message (in
  Python implementation too).
* There where few reference leaks in error cases.
(cherry picked from commit 6655354afc)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-05-20 17:34:28 +03:00
Miss Islington (bot) 28ea38b97b
bpo-26819: Prevent proactor double read on resume (GH-6921)
The proactor event loop has a race condition when reading with
pausing/resuming. `resume_reading()` unconditionally schedules the read
function to read from the current future. If `resume_reading()` was
called before the previously scheduled done callback fires, this results
in two attempts to get the data from the most recent read and an
assertion failure. This commit tracks whether or not `resume_reading`
needs to reschedule the callback to restart the loop, preventing a
second attempt to read the data.
(cherry picked from commit 4151061855)

Co-authored-by: CtrlZvi <viz+github@flippedperspective.com>
2018-05-20 03:57:32 -07:00
Miss Islington (bot) 222ae1eccc bpo-30928: Update idlelib/NEWS.txt. (GH-6995) (#6996)
(cherry picked from commit 6b0d09b8f0)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2018-05-19 22:01:26 -04:00
Miss Islington (bot) 0efa1353b7
bpo-32831: IDLE: Add docstrings and tests for codecontext (GH-5638)
(cherry picked from commit 654038d896)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
2018-05-19 13:28:03 -07:00
Miss Islington (bot) 09ca5906b7 bpo-28556: Don't simplify unions at runtime (GH-6841) (GH-6979)
(cherry picked from commit f65e31fee3)

Co-authored-by: Ivan Levkivskyi <levkivskyi@gmail.com>
2018-05-18 16:27:14 -07:00
Miss Islington (bot) abde17e663 bpo-33556: Remove reference to thread module from docstring (GH-6963)
(cherry picked from commit 5634331a76)

Co-authored-by: Skip Montanaro <skip.montanaro@gmail.com>
2018-05-18 14:46:43 -05:00
Miss Islington (bot) b2a02b9d88 bpo-33564: Add async to IDLE's code context block openers. (GH-6960) (#6961)
(cherry picked from commit d89ca94847)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2018-05-17 22:04:23 -04:00
Miss Islington (bot) 56882db4f7 Provide a little better debug output (GH-6940) (#6942)
(cherry picked from commit 273f51f5ca)

Co-authored-by: Barry Warsaw <barry@python.org>
2018-05-17 12:53:24 -04:00
Miss Islington (bot) 6417d33633 bpo-33537: Add an __all__ to importlib.resources (GH-6920) (#6941)
(cherry picked from commit 0ed66df524)

Co-authored-by: Barry Warsaw <barry@python.org>
2018-05-17 12:27:49 -04:00
Miss Islington (bot) 8965d75c90 bpo-33522: Enable CI builds on Visual Studio Team Services (GH-6865) (GH-6926)
(cherry picked from commit e5f41d2f1e)

Co-authored-by: Steve Dower <steve.dower@microsoft.com>
2018-05-17 08:49:01 -04:00
Miss Islington (bot) 216a27766f bpo-33549: Remove shim and deprecation warning to access DocumentLS.async. (GH-6924) (GH-6929)
`obj.async` is now a syntax error, so the warning/shim is
quasi-unnecessary.
(cherry picked from commit f90f5d5c1d)

Co-authored-by: Matthias Bussonnier <bussonniermatthias@gmail.com>
2018-05-17 12:01:02 +03:00
Miss Islington (bot) 9c17cd3214 Fix ClassVar as string fails when getting type hints (GH-6824) (#6912)
(cherry picked from commit 2d2d3b170b)

Co-authored-by: Nina Zakharenko <nzakharenko@gmail.com>
2018-05-16 18:04:39 -04:00
Miss Islington (bot) 6409e759df
bpo-33536: Validate make_dataclass() field names. (GH-6906)
(cherry picked from commit 4e81296b18)

Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
2018-05-16 09:28:22 -07:00
Miss Islington (bot) 8e20fc388f
bpo-33534: Remove unneeded test. (GH-6897)
This condition as already tested before this code is called.
(cherry picked from commit 9285835a05)

Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
2018-05-16 04:46:32 -07:00
Miss Islington (bot) 8d486fb93a
Reflow dataclasses comments (GH-6893)
To be more consistent with other code (and so people stop hassling me!), reflow the dataclasses comments to not use a single space indentation when continuing a paragraph of text.
(cherry picked from commit f8e7549490)

Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
2018-05-16 02:49:29 -07:00
Miss Islington (bot) 4af6110f77 bpo-32384: Skip test when _testcapi isn't available (GH-4940)
(cherry picked from commit 4cc3eb48e1)

Co-authored-by: Isaiah Peng <isaiah@users.noreply.github.com>
2018-05-16 11:35:06 +03:00
Miss Islington (bot) c73268aad7
bpo-33453: Handle string type annotations in dataclasses. (GH-6768)
(cherry picked from commit 2a7bacbd91)

Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
2018-05-15 21:22:13 -07:00
Miss Islington (bot) 3d484435d2
bpo-30928: Update idlelib/NEWS.txt to 2018-05-14. (GH-6873)
(cherry picked from commit 038b21f2ca)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2018-05-15 17:48:17 -07:00
Miss Islington (bot) 2cdb70ac5d bpo-33465: Use an unlikely to be built-in C extension in a test (GH-6797) (#6869)
(cherry picked from commit 8709b236fc)

Co-authored-by: Barry Warsaw <barry@python.org>
2018-05-15 17:24:26 -04:00
Miss Islington (bot) 820219f786
bpo-33509: Fix _warnings for module_globals=None (GH-6833)
Don't crash on warnings.warn_explicit() if module_globals is not a dict.
(cherry picked from commit b056562860)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2018-05-15 13:56:28 -07:00
Miss Islington (bot) 8717cfeb6b
bpo-29706: Test that IDLE colors async/await as keywords. (GH-6846)
Added to the eye-verified htest, not to the unittests.
Also remove some stray leftover comments.
(cherry picked from commit 389a48ede9)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2018-05-15 12:57:13 -07:00
Miss Islington (bot) f4fdb619dd bpo-28167: bump platform.linux_distribution removal to 3.8 (GH-6669) (GH-6862)
Also bump PendingDeprecationWarning to DeprecationWarning.
(cherry picked from commit 9eb40bc38d)

Co-authored-by: Matthias Bussonnier <bussonniermatthias@gmail.com>
2018-05-15 13:30:06 -04:00
Eric Snow 6bd0c476c5
bpo-32604: Remove xid registry. (#6813)
Remove the interpreters testing helper (and xid registry).
2018-05-15 09:56:18 -04:00
Miss Islington (bot) 5c7e079158
bpo-33517: dataclasses: Add the field type to Field repr (GH-6858)
(cherry picked from commit 01abc6ec3a)

Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
2018-05-15 06:01:51 -07:00
Miss Islington (bot) 2ce72e243f
bpo-16865: Support arrays >=2GB in ctypes. (GH-3006)
(cherry picked from commit 735abadd5b)

Co-authored-by: Segev Finer <segev208@gmail.com>
2018-05-14 22:40:27 -07:00
Miss Islington (bot) b57aeac82c
bpo-33502: dataclass._Dataclassparams repr: use repr of each member. (GH-6812)
(cherry picked from commit 3059042410)

Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
2018-05-14 16:57:30 -07:00
Miss Islington (bot) e8f968dcde bpo-33497: Add errors param to cgi.parse_multipart and make an encoding in FieldStorage use the given errors (GH-6804) (GH-6837)
(cherry picked from commit 545c955be9)

Co-authored-by: Amber Brown <hawkowl@atleastfornow.net>
2018-05-14 18:20:06 -04:00
Pablo Galindo 8e633a4035 bpo-20104: Remove posix_spawn from 3.7 (GH-6794)
Remove os.posix_spawn, the API isn't complete and we're still figuring out how it should look. wait for 3.8.
2018-05-14 17:52:43 -04:00
Miss Islington (bot) c3fa1f2b93 [3.7] bpo-32861: urllib.robotparser fix incomplete __str__ methods. (GH-5711) (GH-6795)
The urllib.robotparser's __str__ representation now includes wildcard
entries and the "Crawl-delay" and "Request-rate" fields.
(cherry picked from commit bd08a0af2d)

Co-authored-by: Michael Lazar <lazar.michael22@gmail.com>
2018-05-14 21:14:30 +03:00
Miss Islington (bot) ceb45f0df8
bpo-33494: Change dataclasses.Fields repr to use the repr of each of its members (GH-6798)
(cherry picked from commit 2473eea65d)

Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
2018-05-14 10:31:10 -07:00
Miss Islington (bot) 2e01f7d5fe
bpo-32601: Let test_expanduser use the same user if no others found. (GH-5246)
This happens in the NixOS build sandbox, for example, where the only
other user is nobody with home directory /.
(cherry picked from commit 5c0d462689)

Co-authored-by: Anders Kaseorg <andersk@mit.edu>
2018-05-14 07:22:05 -07:00
Miss Islington (bot) 6e9456e4f6
bpo-33455: Pass os.environ in test_posix::test_specify_environment. (GH-6753)
Pass os.environ's copy to new process created at test_posix:
test_specify_environment. Otherwise important variables such as
LD_LIBRARY_PATH are not set and the child process might not work at all
in an environment where such variables are required for Python to function.
(cherry picked from commit 7ec8f28656)

Co-authored-by: Miro Hrončok <miro@hroncok.cz>
2018-05-10 23:01:44 -07:00
Miss Islington (bot) c5444b3556
Fix a bug in Generic.__new__ (GH-6758)
(cherry picked from commit b551e9f0ff)

Co-authored-by: Ivan Levkivskyi <levkivskyi@gmail.com>
2018-05-10 20:30:47 -07:00
Miss Islington (bot) 263523ae21
closes bpo-33445: fail properly in test_cprofile() (GH-6727)
(cherry picked from commit ac9240b9be)

Co-authored-by: jdemeyer <jdemeyer@cage.ugent.be>
2018-05-08 21:38:00 -07:00
Miss Islington (bot) 3c28a6387b
bpo-28556: Minor fixes for typing module (GH-6732)
This also fixes https://bugs.python.org/issue33420
(cherry picked from commit 43d12a6bd8)

Co-authored-by: Ivan Levkivskyi <levkivskyi@gmail.com>
2018-05-08 18:44:09 -07:00
Miss Islington (bot) 6049bda21b [3.7] bpo-20087: Update locale alias mapping with glibc 2.27 supported locales. (GH-6708) (GH-6713)
(cherry picked from commit cedc9b7420)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-05-06 10:20:12 +03:00
Miss Islington (bot) 351782b992
bpo-33422: Fix quotation marks getting deleted when looking up byte/string literals on pydoc. (GH-6701)
Also update the list of string prefixes.
(cherry picked from commit b2043bbe60)

Co-authored-by: Andrés Delfino <adelfino@gmail.com>
2018-05-05 09:42:56 -07:00
Ned Deily eb96c37699 3.7.0b4 2018-05-02 03:41:45 -04:00
Miss Islington (bot) c74ca5396a bpo-33281: Fix ctypes.util.find_library regression on macOS (GH-6625) (GH-6680)
(cherry picked from commit d06d345f04)

Co-authored-by: Ray Donnelly <mingw.android@gmail.com>
2018-05-01 22:51:31 -04:00
Miss Islington (bot) 77fa7835da
bpo-20104: Improve error handling and fix a reference leak in os.posix_spawn(). (GH-6332)
(cherry picked from commit ef347535f2)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-05-01 07:18:44 -07:00
Miss Islington (bot) e4eeb6eff1
bpo-31908: Fix output of cover files for trace module command-line tool. (GH-4205)
Previously emitted cover files only when --missing option was used.
(cherry picked from commit 47ab15470d)

Co-authored-by: Michael Selik <mike@selik.org>
2018-04-30 21:06:00 -07:00
Miss Islington (bot) 8075868f19 bpo-33352: Skip test_regrtest test if rt.bat does not exist (GH-6654) (#6656)
(cherry picked from commit c3b7a6dfb9)

Co-authored-by: Andrés Delfino <adelfino@gmail.com>
2018-04-30 22:36:49 +02:00
Miss Islington (bot) 2e5fa38c5a
bpo-33254: do not return an empty list when asking for the contents of a namespace package (GH-6467)
(cherry picked from commit 3ab9365dca)

Co-authored-by: Brett Cannon <brettcannon@users.noreply.github.com>
2018-04-30 12:30:26 -07:00
Miss Islington (bot) 887b5f8fc6
bpo-21474: Update IDLE word/identifier definition from ascii to unicode. (GH-6643)
In text and entry boxes, this affects selection by double-click,
movement left/right by control-left/right, and deletion left/right
by control-BACKSPACE/DEL.
(cherry picked from commit 5ff3a161c8)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2018-04-30 00:27:50 -07:00
Miss Islington (bot) 736f17fb8d
bpo-33256: Replace angle brackets around python object repr to display it in html (GH-6442)
(cherry picked from commit 7d68bfa826)

Co-authored-by: sblondon <sblondon@users.noreply.github.com>
2018-04-29 12:10:12 -07:00
Miss Islington (bot) e57d3e3a13
bpo-31026: Fix test_dbm if dbm.ndbm is build with Berkeley DB. (GH-6632)
(cherry picked from commit 70af06cdc4)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-04-29 06:37:21 -07:00
Miss Islington (bot) ee95feb69d [3.7] bpo-33383: Fix crash in get() of the dbm.ndbm database object. (GH-6630) (GH-6631)
(cherry picked from commit 2e38cc3933)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-04-29 14:50:26 +03:00
Zsolt Dollenstein a93a663d6c [3.7] bpo-33363: raise SyntaxError for async for/with outside async functions (GH-6616). (GH-6619) 2018-04-27 18:33:37 -04:00
Miss Islington (bot) dd3ede7537
bpo-33358: Fix test_embed.test_pre_initialization_sys_options (GH-6612)
Fix test_embed.test_pre_initialization_sys_options() when building with --enable-shared
(cherry picked from commit 4114846265)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2018-04-27 05:41:25 -07:00
Miss Islington (bot) 52a5a17338
bpo-33128 Fix duplicated call to importlib._install_external_importers (GH-6273)
External importers were being added in both phases of the import
system initialisation.

They're only supposed to be added in the second phase, after the
import machinery has been appropriately configured.
(cherry picked from commit 0977091dca)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2018-04-24 19:48:04 -07:00
Miss Islington (bot) 9fc998d761 bpo-991266: Fix quoting of Comment attribute of SimpleCookie (GH-6555)
(cherry picked from commit d5a2377c3d)

Co-authored-by: Berker Peksag <berker.peksag@gmail.com>
2018-04-23 03:58:23 +03:00
Miss Islington (bot) 32955299b4
Spelling fixes to docs, docstrings, and comments (GH-6374)
(cherry picked from commit 61f82e0e33)

Co-authored-by: Ville Skyttä <ville.skytta@iki.fi>
2018-04-20 14:00:41 -07:00
Miss Islington (bot) b221107d32
bpo-33131: Upgrade ensurepip to bundle pip 10.0.1 (GH-6546)
Upgrade ensurepip to bundle pip 10.0.1
(cherry picked from commit 0399cf9b5e)

Co-authored-by: Paul Moore <p.f.moore@gmail.com>
2018-04-20 13:47:44 -07:00
Miss Islington (bot) a4fb580f70
bpo-33189: pygettext.py now accepts only literal strings (GH-6364)
as docstrings and translatable strings, and rejects
bytes literals and f-string expressions.
(cherry picked from commit 69524821a8)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-04-18 23:49:15 -07:00
Miss Islington (bot) b27c71cdc0
bpo-33308: Fix a crash in the parser module when convert an ST object. (GH-6519)
Converting with line_info=False and col_info=True crashed before.
(cherry picked from commit e5362eaa75)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-04-18 22:10:36 -07:00
Miss Islington (bot) 67067d85eb bpo-31583: Fix 2to3 for using with --add-suffix option (GH-3758) (#6528)
(cherry picked from commit e3a523a0fa)

Co-authored-by: Denis Osipov <osipov_d@list.ru>
2018-04-18 17:15:09 -07:00
Miss Islington (bot) b88f73749d
bpo-33283: Mention PNG as a supported format by Tcl/Tk. (GH-6479)
(cherry picked from commit 4b685bf719)

Co-authored-by: Andrés Delfino <34587441+andresdelfino@users.noreply.github.com>
2018-04-18 11:16:46 -07:00
Miss Islington (bot) 3b3be1fe10
bpo-11594: Ensure line-endings are respected when using 2to3 (GH-6483)
(cherry picked from commit c127a86e18)

Co-authored-by: Aaron Ang <aaronang@users.noreply.github.com>
2018-04-17 14:58:34 -07:00
Miss Islington (bot) ed1265526f Fix spelling typo (GH-6443) (GH-6507)
(cherry picked from commit 28e8b66d6c)

Co-authored-by: jdemeyer <jdemeyer@cage.ugent.be>
2018-04-17 11:40:48 -04:00
Miss Islington (bot) f7379ddf1c bpo-33295: Skip test using missing external site (GH-6504) (GH-6509)
`test_urllib2net.OtherNetworkTests.test_sites_no_connection_close`
used `http://www.imdb.com/` but it is moved to https so the test is
not valid anymore.  Skip test for the moment to allow CI to proceed.
(cherry picked from commit 36d56ea826)

Co-authored-by: INADA Naoki <methane@users.noreply.github.com>
2018-04-17 11:33:48 -04:00
Miss Islington (bot) dd6bdf610b Add support for all string literals to lib2to3 (GH-6457) (GH-6488)
(cherry picked from commit 8f37e84664)

Co-authored-by: Zsolt Dollenstein <zsol.zsol@gmail.com>
2018-04-16 15:16:57 -07:00
Miss Islington (bot) 3bcca488fe
bpo-31947: remove None default for names param in Enum._create_ (GH-4288)
(cherry picked from commit b8e21f1289)

Co-authored-by: anentropic <ego@anentropic.com>
2018-04-16 13:49:34 -07:00
Miss Islington (bot) 986eaa86da
bpo-33185: Improve wording and markup (GH-6477)
Adds some working and markup fixes that I missed
in the initial commit for this issue.

(Follow-up to GH-6419)
(cherry picked from commit 1a5c4bdb6e)

Co-authored-by: Nick Coghlan <ncoghlan@gmail.com>
2018-04-15 06:55:10 -07:00
Miss Islington (bot) d7ffa58207
bpo-33185: Fix regression in pydoc CLI sys.path handling (GH-6419)
The pydoc CLI assumed -m pydoc would add the empty string
to sys.path, and hence got confused when it switched to
adding the full initial working directory instead.

This refactors the pydoc CLI path manipulation to be
more testable, and ensures it won't accidentally
remove the standard library directory containing
pydoc itself from sys.path.
(cherry picked from commit 82a9481059)

Co-authored-by: Nick Coghlan <ncoghlan@gmail.com>
2018-04-15 05:17:13 -07:00
Ethan Furman 3715176557
[3.7] bpo-33217: deprecate non-Enum lookups in Enums (GH-6392)
deprecate non-Enum lookups in Enums

Lookups such as `1 in Color` and `2 in SomeFlag()` will raise TypeError
in 3.8+.
2018-04-11 18:56:25 -07:00
Miss Islington (bot) 4dc3c8ff14
bpo-33260: Regenerate token.py after removing ASYNC and AWAIT. (GH-6447)
(cherry picked from commit d08972fdb9)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-04-11 10:07:23 -07:00
Miss Islington (bot) b26265900a bpo-33097: Fix submit accepting callable after executor shutdown by interpreter exit (GH-6144) (GH-6445)
Executors in concurrent.futures accepted tasks after executor was shutdown by interpreter exit. Tasks were left in PENDING state forever. This fix changes submit to instead raise a RuntimeError.
(cherry picked from commit c4b695f85e)

Co-authored-by: Mark Nemec <mrknmc@me.com>
2018-04-10 20:35:02 +02:00
Miss Islington (bot) 9b25bd6e26
bpo-31920: Fixed handling directories as arguments in the ``pygettext`` script. (GH-6259)
Based on patch by Oleg Krasnikov.
(cherry picked from commit c93938b5be)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-04-09 10:57:52 -07:00
Miss Islington (bot) 558e7e42be
Fix misleading docsting of shelve.open(). (GH-6427)
The protocol parameter can be any protocol supported by the
pickle module.
(cherry picked from commit 2ef65f346a)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-04-09 07:57:31 -07:00
Miss Islington (bot) d964f51f81
Update docstring of tempfile._RandomNameSequence (GH-6414)
When bpo-12015 got resolved by increasing the length of the
random string generated by _RandomNameSequence from six to eight
characters, the docstring of the class was not adjusted accordingly.
(cherry picked from commit 9c463ec88b)

Co-authored-by: Wolfgang Maier <wolfgang.maier@biologie.uni-freiburg.de>
2018-04-08 18:01:54 -07:00
Miss Islington (bot) 8a72266eca Add a prepend() recipe to teach a chain() idiom (GH-6415) (GH-6421)
(cherry picked from commit 9265dd72e5)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
2018-04-08 14:37:30 -07:00
Brett Cannon a09bb87c1e
[3.7] bpo-33169: Remove values of `None` from sys.path_importer_cache when invalidating caches (GH-6402) (GH-6403)
An entry of None in sys.path_importer_cache represents a negative/missing finder for a path, so clearing it out makes sense.
(cherry picked from commit 9e2be60634)
2018-04-06 17:02:18 -07:00
Miss Islington (bot) 28c179094b bpo-33224: PEP 479 fix for difflib.mdiff() (GH-6381) (GH-6390) 2018-04-05 11:45:33 -07:00
Miss Islington (bot) baf304e82e bpo-33203: Ensure random.choice always raises IndexError on empty sequence (GH-6338) (GH-6387)
(cherry picked from commit 091e95e900)

Co-authored-by: Wolfgang Maier <wolfgang.maier@biologie.uni-freiburg.de>
2018-04-05 09:02:12 -07:00
Miss Islington (bot) 83f564fd24
Clean up and enhance frozen dataclass tests. (GH-6380)
* Add a test for frozen with unhashable field value.
* Improve a comment.
(cherry picked from commit 74940913d2)

Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
2018-04-05 04:12:31 -07:00
Miss Islington (bot) 04eac02088
bpo-32873: Remove a name hack for generic aliases in typing module (GH-6376)
This removes a hack and replaces it with a proper
mapping {'list': 'List', 'dict': 'Dict', ...}.
(cherry picked from commit 2a363d2930)

Co-authored-by: Ivan Levkivskyi <levkivskyi@gmail.com>
2018-04-04 17:46:40 -07:00
Miss Islington (bot) bd85c97382
Call super in Generic.__init_subclass__ (GH-6356)
(cherry picked from commit ee566fe526)

Co-authored-by: Ivan Levkivskyi <levkivskyi@gmail.com>
2018-04-04 09:51:34 -07:00
Miss Islington (bot) 785f36c876
bpo-29922: Add more tests for error messages in 'async with'. (GH-6370)
Different paths are executed for normal exit and for leaving
the 'async with' block with 'break', 'continue' or 'return'.
(cherry picked from commit 2eeac269dd)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-04-04 09:28:46 -07:00
Miss Islington (bot) fcd4e03e08
bpo-29922: Improve error messages in 'async with' (GH-6352)
when __aenter__() or __aexit__() return non-awaitable object.
(cherry picked from commit a68f2f0578)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-04-04 07:09:00 -07:00
Miss Islington (bot) 74735e2a40 bpo-33209: End framing at the end of C implementation of pickle.Pickler.dump(). (GH-6366)
(cherry picked from commit c869529ea9)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-04-03 14:35:11 -07:00
Miss Islington (bot) 0c533573c5
bpo-32360: Remove object_pairs_hook=OrderedDict examples (GH-5001)
(cherry picked from commit 629338f140)

Co-authored-by: INADA Naoki <methane@users.noreply.github.com>
2018-04-02 21:31:27 -07:00
Miss Islington (bot) fa91aff07c
bpo-33204: IDLE - revise and extend colorizer test. (GH-6347)
Followup to primary PR for the issue, GH-6344.
(cherry picked from commit 55966f3a0d)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2018-04-02 09:03:52 -07:00
Miss Islington (bot) 6130675efe
bpo-33204: IDLE: consistently color invalid string prefixes (GH-6344)
A 'u' string prefix cannot be paired with either 'r' or 'f'.  Consistently
color as much of the prefix, starting at the right, as is valid.
(cherry picked from commit da58533ac6)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2018-04-01 23:09:18 -07:00
Miss Islington (bot) d063ad8962 Allow dynamic creation of generic dataclasses (GH-6319) (GH-6320)
(cherry picked from commit 5a7092de12)

Co-authored-by: Ivan Levkivskyi <levkivskyi@gmail.com>
2018-04-01 12:33:13 +01:00
Miss Islington (bot) faa6f5c74c
bpo-33175: dataclasses should look up __set_name__ on class, not instance (GH-6305)
(cherry picked from commit 521995205a)

Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
2018-03-29 08:32:36 -07:00
Ned Deily 4e7efa9c6f 3.7.0b3 2018-03-29 07:57:55 -04:00
Serhiy Storchaka fd93666c8a
[3.7] Fix duplicating words words. (GH-6296) (GH-6297)
Most of them have been added in 3.7.
(cherry picked from commit bac2d5ba30)
2018-03-28 23:05:24 +03:00
Miss Islington (bot) d2d5bd8bc4 bpo-32872: Avoid regrtest compatibility issue with namespace packages. (GH-6276) (#6277)
(cherry picked from commit e52ac04597)

Co-authored-by: Ned Deily <nad@python.org>
2018-03-28 02:39:19 -04:00
Miss Islington (bot) 211c0dbc6a Fix senfile typo (GH-6265) (#6274)
* Also in docs
(cherry picked from commit 65a34709f6)

Co-authored-by: Sam Dunster <me@sdunster.com>
2018-03-27 18:34:15 -07:00
Ned Deily 6a2539c434
bpo-32517: re-enable test_read_pty_output on macOS (GH-6112) 2018-03-27 17:17:28 -04:00
Miss Islington (bot) fd1b8f87b3 bpo-33151: Handle submodule resources (GH-6268) (GH-6270)
(cherry picked from commit 30e507dff4)

Co-authored-by: Barry Warsaw <barry@python.org>
2018-03-27 10:25:28 -07:00
Miss Islington (bot) f328caf4ca bpo-27212: Modify islice recipe to consume initial values preceding start (GH-6195) (#GH-6266)
(cherry picked from commit da1734c58d)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
2018-03-26 19:23:34 -07:00
Miss Islington (bot) d0e04c8244
bpo-32873: Treat type variables and special typing forms as immutable by copy and pickle (GH-6216)
This also fixes python/typingGH-512
This also fixes python/typingGH-511

As was discussed in both issues, some typing forms deserve to be treated
as immutable by copy and pickle modules, so that:
* copy(X) is X
* deepcopy(X) is X
* loads(dumps(X)) is X  GH- pickled by reference

This PR adds such behaviour to:
* Type variables
* Special forms like Union, Any, ClassVar
* Unsubscripted generic aliases to containers like List, Mapping, Iterable

This not only resolves inconsistencies mentioned in the issues, but also
improves backwards compatibility with previous versions of Python
(including 3.6).

Note that this requires some dances with __module__ for type variables
(similar to NamedTuple) because the class TypeVar itself is define in typing,
while type variables should get module where they were defined.

https://bugs.python.org/issue32873
(cherry picked from commit 834940375a)

Co-authored-by: Ivan Levkivskyi <levkivskyi@gmail.com>
2018-03-26 15:29:06 -07:00
Miss Islington (bot) 05455637f3
bpo-32844: Fix a subprocess misredirection of a low fd (GH5689)
bpo-32844: subprocess: Fix a potential misredirection of a low fd to stderr.

When redirecting, subprocess attempts to achieve the following state:
each fd to be redirected to is less than or equal to the fd
it is redirected from, which is necessary because redirection
occurs in the ascending order of destination descriptors.
It fails to do so in a couple of corner cases,
for example, if 1 is redirected to 2 and 0 is closed in the parent.
(cherry picked from commit 0e7144b064)

Co-authored-by: Alexey Izbyshev <izbyshev@users.noreply.github.com>
2018-03-26 13:14:09 -07:00
Miss Islington (bot) c6147acd2c
bpo-33141: Have dataclasses.Field pass through __set_name__ to any default argument. (GH-6260)
This is part of PEP 487 and the descriptor protocol.
(cherry picked from commit de7a2f04d6)

Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
2018-03-26 10:55:13 -07:00
Miss Islington (bot) a7b1b847f6
bpo-33096: Fix ttk.Treeview.insert. (GH-6228)
Allow ttk.Treeview.insert to insert iid that has a false boolean value.
Note iid=0 and iid=False would be same.
(cherry picked from commit 3ab44c0783)

Co-authored-by: Garvit Khatri <garvitdelhi@gmail.com>
2018-03-26 01:19:52 -07:00
Miss Islington (bot) 5fc6fc85c4
Minor fixes to dataclass tests. (GH-6243)
Also, re-enable a test for ClassVars with default_factory.
(cherry picked from commit 2b75fc2bc9)

Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
2018-03-25 18:00:43 -07:00
Nick Coghlan ee3784594b
bpo-33053: -m now adds *starting* directory to sys.path (GH-6231) (#6236)
Historically, -m added the empty string as sys.path
zero, meaning it resolved imports against the current
working directory, the same way -c and the interactive
prompt do.

This changes the sys.path initialisation to add the
*starting* working directory as sys.path[0] instead,
such that changes to the working directory while the
program is running will have no effect on imports
when using the -m switch.

(cherry picked from commit d5d9e02dd3)
2018-03-25 23:43:50 +10:00
Miss Islington (bot) 5666a55da8
Trivial improvements to dataclasses tests. (GH-6234)
(cherry picked from commit 51c9ab42ab)

Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
2018-03-25 06:27:50 -07:00
Miss Islington (bot) 2dd885eaa0 [3.7] bpo-33136: Harden ssl module against CVE-2018-8970 (GH-6229) (GH-6230)
Harden ssl module against LibreSSL CVE-2018-8970.
X509_VERIFY_PARAM_set1_host() is called with an explicit namelen. A new test
ensures that NULL bytes are not allowed.

Signed-off-by: Christian Heimes <christian@python.org>
(cherry picked from commit d02ac25ab0)

Co-authored-by: Christian Heimes <christian@python.org>
2018-03-25 13:28:20 +02:00
Miss Islington (bot) c6d94c37f4
bpo-33042: Fix pre-initialization sys module configuration (GH-6157)
- new test case for pre-initialization of sys.warnoptions and sys._xoptions
- restored ability to call these APIs prior to Py_Initialize
- updated the docs for the affected APIs to make it clear they can be
  called before Py_Initialize
- also enhanced the existing embedding test cases
  to check for expected settings in the sys module
(cherry picked from commit bc77eff8b9)

Co-authored-by: Nick Coghlan <ncoghlan@gmail.com>
2018-03-25 04:27:57 -07:00
Miss Islington (bot) 291d5f3e71
bpo-32943: Fix confusing error message for rot13 codec (GH-5869)
(cherry picked from commit e4ce9fa89c)

Co-authored-by: Xiang Zhang <angwerzx@126.com>
2018-03-24 21:30:39 -07:00
Miss Islington (bot) 5729b9c0e9
Fix invalid escape sequence: use raw string. (GH-6225)
(cherry picked from commit c42e7aa67c)

Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
2018-03-24 20:23:00 -07:00
Miss Islington (bot) 9989efbb65
bpo-33134: dataclasses: use function dispatch table for hash, instead of a string lookup which then is tested with if tests. (GH-6222)
* Change _hash_action to be a function table lookup, instead of a list
of strings which is then tested with if statements.
(cherry picked from commit 01d618c560)

Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
2018-03-24 19:31:29 -07:00
Miss Islington (bot) 02c19a6fc0
Trivial dataclass cleanups: (GH-6218)
- When adding a single element to a list, use .append() instead of
  += and creating a new list.
- For consistency, import the copy module, instead of just deepcopy. This
  leaves only a module at the class level, instead of a function.
- Improve some comments.
- Improve some whitespace.
- Use tuples instead of lists.
- Simplify a test.
(cherry picked from commit f96ddade00)

Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
2018-03-24 14:42:28 -07:00
Miss Islington (bot) 1a0bb626f4 [3.7] bpo-24334: Remove inaccurate match_hostname call (GH-6211) (#6212)
Commit 141c5e8c re-added match_hostname() call. The resurrection of the
function call was never intended and was solely a merge mistake.

Signed-off-by: Christian Heimes <christian@python.org>
(cherry picked from commit e42ae91509)

Co-authored-by: Christian Heimes <christian@python.org>
2018-03-24 15:59:16 +01:00
Ivan Levkivskyi ac5602746e
bpo-33061: Add missing 'NoReturn' to __all__ in typing.py (GH-6127) (#6162) 2018-03-23 21:44:54 +00:00
Miss Islington (bot) f8d2c3cf5f
bpo-31639: Use threads in http.server module. (GH-5018)
(cherry picked from commit 8bcfa02e4b)

Co-authored-by: Julien Palard <julien@palard.fr>
2018-03-23 13:31:20 -07:00
Serhiy Storchaka b9744e924c
bpo-33041: Fixed jumping if the function contains an "async for" loop. (GH-6154) 2018-03-23 14:35:33 +02:00
Miss Islington (bot) 3b4c6b16c5
bpo-32505: dataclasses: raise TypeError if a member variable is of type Field, but doesn't have a type annotation. (GH-6192)
If a dataclass has a member variable that's of type Field, but it doesn't have a type annotation, raise TypeError.
(cherry picked from commit 56970b8ce9)

Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
2018-03-22 13:58:59 -07:00
Miss Islington (bot) 346964ba05
bpo-33018: Improve issubclass() error checking and message. (GH-5944)
This improves error message for situations when a non-class is
checked w.r.t. an abstract base class.
(cherry picked from commit 40472dd42d)

Co-authored-by: jab <jab@users.noreply.github.com>
2018-03-22 04:49:26 -07:00
Miss Islington (bot) 8f46176f0e Upgrade pip to v9.0.3 and setuptools to v39.0.1 (GH-6184)
(cherry picked from commit d93b5161af)

Co-authored-by: Donald Stufft <donald@stufft.io>
2018-03-21 23:38:24 -04:00
Miss Islington (bot) 4ddc99d159 bpo-33116: Add 'Field' to dataclasses.__all__. (GH-6182) (GH-6183)
- Add missing 'Field' to __all__.
- Improve tests to catch this.
(cherry picked from commit 8e4560a9da)

Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
2018-03-21 17:44:23 -04:00
Miss Islington (bot) f5625d58fa FIX failure on OSX sem_getvalue (GH-6180) (GH-6181)
(cherry picked from commit dec1c7786f)

Co-authored-by: Thomas Moreau <thomas.moreau.2010@gmail.com>
2018-03-21 20:00:55 +01:00
Miss Islington (bot) bb5b529197 bpo-33078 - Fix queue size on pickling error (GH-6119) (GH-6178)
(cherry picked from commit e2f33add63)

Co-authored-by: Thomas Moreau <thomas.moreau.2010@gmail.com>
2018-03-21 17:21:15 +01:00
Miss Islington (bot) 22136c94b6 bpo-32896: Fix error when subclassing a dataclass with a field that uses a default_factory (GH-6170) (GH-6171)
Fix the way that new annotations in a class are detected.
(cherry picked from commit 8f6eccdc64)

Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
2018-03-21 05:17:30 -04:00
Miss Islington (bot) 3326c9267f
bpo-27683: Fix a regression for host() of ipaddress network objects (GH-6016)
The result of host() was not empty when the network is constructed by a tuple containing an
integer mask and only 1 bit left for addresses.
(cherry picked from commit 10b134a07c)

Co-authored-by: Xiang Zhang <angwerzx@126.com>
2018-03-20 18:22:23 -07:00
Miss Islington (bot) a323eee4c4
bpo-18802: Add more details to ipaddress documentation (GH-6083)
Original patch by Jon Foster and Berker Peksag.
(cherry picked from commit 5609b78392)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
2018-03-20 17:30:43 -07:00
Miss Islington (bot) 3d41f48259 bpo-33100: Dataclasses now handles __slots__ and default values correctly. (GH-6152) (GH-6153)
If the class has a member that's a MemberDescriptorType, it's not a default value, it's from that member being in __slots__.
(cherry picked from commit 7389fd935c)

Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
2018-03-19 21:31:22 -04:00
Miss Islington (bot) 45648312e5 bpo-32953: Dataclasses: frozen should not be inherited for non-dataclass derived classes (GH-6147) (GH-6148)
If a non-dataclass derives from a frozen dataclass, allow attributes to be set.
Require either all of the dataclasses in a class hierarchy to be frozen, or all non-frozen.
Store `@dataclass` parameters on the class object under `__dataclass_params__`. This is needed to detect frozen base classes.
(cherry picked from commit f199bc655e)

Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
2018-03-18 21:03:36 -04:00
Miss Islington (bot) 3c0a5a7c7b
bpo-32056: Improve exceptions in aifc, wave and sunau. (GH-5951)
(cherry picked from commit 134cb01cda)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-03-18 13:50:41 -07:00
Miss Islington (bot) fdd8e8b4ff
bpo-19417: Add test_bdb.py (GH-5217)
(cherry picked from commit 3fe33043ee)

Co-authored-by: xdegaye <xdegaye@gmail.com>
2018-03-18 13:25:15 -07:00
Miss Islington (bot) a90df5085b
Revert "bpo-30406: Make async and await proper keywords (GH-1669)" (GH-6143)
This reverts commit ac317700ce.

(Reverts only the lib2to3 part.)
(cherry picked from commit f64aae46da)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2018-03-18 12:15:52 -07:00
Serhiy Storchaka 773573e9ac
[3.7] bpo-33041: Add tests for jumps in/out of 'async with' blocks. (GH-6110). (GH-6140)
(cherry picked from commit bc300ce205)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-03-18 12:31:37 +02:00
Miss Islington (bot) 429ca448d2 bpo-27645: Fix version number in 'database in transaction' fallback (GH-6131)
It was actually fixed in SQLite 3.8.8, not 3.8.7.

(cherry picked from commit bbf7bb7a63)

Co-authored-by: Aviv Palivoda <palaviv@gmail.com>
2018-03-18 09:24:33 +03:00
Miss Islington (bot) d7b8103741 Update pip to 9.0.2 and setuptools to 38.6.1 (GH-6133) (#6134)
(cherry picked from commit 7f81bb2add)

Co-authored-by: Donald Stufft <donald@stufft.io>
2018-03-17 11:46:05 -04:00
Miss Islington (bot) 136905fffd
bpo-32374: m_traverse may be called with m_state=NULL (GH-5140)
Multi-phase initialized modules allow m_traverse to be called while the
module is still being initialized, so module authors may need to account
for that.
(cherry picked from commit c2b0b12d1a)

Co-authored-by: Marcel Plch <gmarcel.plch@gmail.com>
2018-03-16 23:03:56 -07:00
Miss Islington (bot) 7d0528dd3f lib2to3: Add more tests (GH-6101) (#6108)
(cherry picked from commit 74f56878cd)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2018-03-13 11:20:38 -07:00
Miss Islington (bot) f216cbf9ab bpo-33056 FIX leaking fd in concurrent.futures.ProcessPoolExecutor (GH-6084) (#6092)
(cherry picked from commit 095ee415ce)

Co-authored-by: Thomas Moreau <thomas.moreau.2010@gmail.com>
2018-03-13 10:10:57 +01:00
xdegaye e32bbaf376 [3.7] bpo-17288: Prevent jumps from 'return' and 'exception' trace events. (GH-5928) 2018-03-13 10:52:35 +02:00
Miss Islington (bot) b4c8871ca4 bpo-33064: lib2to3: support trailing comma after *args and **kwargs (GH-6096) (#6097)
New tests also added.

I also made the comments in line with the builtin Grammar/Grammar. PEP 306 was
withdrawn, Kees Blom's railroad program has been lost to the sands of time for
at least 16 years now (I found a python-dev post from people looking for it).
(cherry picked from commit b51f5de711)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2018-03-13 01:08:02 -07:00
Miss Islington (bot) ff5d21331e bpo-31804: Fix multiprocessing.Process with broken standard streams (GH-6079) (GH-6080)
In some conditions the standard streams will be None or closed in the child process (for example if using "pythonw" instead of "python" on Windows).  Avoid failing with a non-0 exit code in those conditions.

Report and initial patch by poxthegreat.
(cherry picked from commit e756f66c83)

Co-authored-by: Antoine Pitrou <pitrou@free.fr>
2018-03-11 19:42:37 +01:00
Serhiy Storchaka 04aadf23ea
[3.7] bpo-33026: Fix jumping out of "with" block by setting f_lineno. (GH-6026). (#6074)
(cherry picked from commit 26c9f565d0)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-03-11 09:30:13 +02:00
Miss Islington (bot) 39441fce02
bpo-32338: OrderedDict import is no longer needed in re. (GH-4891)
(cherry picked from commit b931bd0a2f)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-03-10 23:01:58 -08:00
Miss Islington (bot) c546a62c4d bpo-27645: Skip test_bad_target_in_transaction if SQLite == 3.8.7.1 (GH-6067)
(cherry picked from commit 7280a4eef5)

Co-authored-by: Berker Peksag <berker.peksag@gmail.com>
2018-03-11 03:59:11 +03:00
Miss Islington (bot) e8a5a92037 bpo-27645: Add support for native backup facility of SQLite (GH-4238)
(cherry picked from commit d7aed4102d)

Co-authored-by: Emanuele Gaifas <lelegaifax@gmail.com>
2018-03-11 01:29:19 +03:00
Miss Islington (bot) bf0d116517 bpo-33037: Skip sending/receiving after SSL transport closing (GH-6044) (GH-6057)
* Skip write()/data_received() if sslpipe is destroyed
(cherry picked from commit 5e80a71ab6)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
2018-03-10 18:27:01 +02:00
Miss Islington (bot) 3c39beb65d
bpo-32517: fix test_read_pty_output() hangs on macOS 10.13.2+ (GH-6037)
test_asyncio hangs indefinitely on macOS 10.13.2+ on `read_pty_output()`
using the KqueueSelector. Closing `proto.transport` (as is done in
`write_pty_output()`) seems to fix it.
(cherry picked from commit 12f74d8608)

Co-authored-by: Nathan Henrie <n8henrie@users.noreply.github.com>
2018-03-09 10:14:14 -08:00
Miss Islington (bot) d824b4e4af
bpo-32999: Fix ABC.__subclasscheck__ crash (GH-6002)
(cherry picked from commit fc7df0e664)

Co-authored-by: INADA Naoki <methane@users.noreply.github.com>
2018-03-06 23:47:40 -08:00
Miss Islington (bot) c4d77a6611
bpo-32969: Expose some missing constants in zlib and fix the doc (GH-5988)
(cherry picked from commit bc3f2289b9)

Co-authored-by: Xiang Zhang <angwerzx@126.com>
2018-03-06 21:26:19 -08:00
Miss Islington (bot) 112f799666
bpo-33009: Fix inspect.signature() for single-parameter partialmethods. (GH-6004)
(cherry picked from commit 8a387219bd)

Co-authored-by: Yury Selivanov <yury@magic.io>
2018-03-06 10:23:48 -08:00
Miss Islington (bot) 5a0c3987ab bpo-32991: Restore expectation that inspect.getfile raises TypeError on namespace package (GH-5980) (GH-5997)
* bpo-32991: Add test capturing expectation.

DocTestFinder.find should return an empty list for doctests in a namespace package.

* bpo-32991: Restore expectation that inspect.getfile on a namespace package raises TypeError.
(cherry picked from commit b9650a04a8)

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
2018-03-06 10:16:11 -05:00
Miss Islington (bot) 96fdbacb77
bpo-33001: Prevent buffer overrun in os.symlink (GH-5989)
(cherry picked from commit 6921e73e33)

Co-authored-by: Steve Dower <steve.dower@microsoft.com>
2018-03-05 15:12:56 -08:00
Miss Islington (bot) fd340bf9e3
bpo-32984: IDLE - set __file__ for startup files (GH-5981)
Like Python, IDLE optionally runs one startup file in the Shell window
before presenting the first interactive input prompt.  For IDLE,
option -s runs a file named in environmental variable IDLESTARTUP or
PYTHONSTARTUP; -r file runs file.  Python sets __file__ to the startup
file name before running the file and unsets it before the first
prompt.  IDLE now does the same when run normally, without the -n
option.
(cherry picked from commit 22c82be5df)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2018-03-05 08:49:15 -08:00
Miss Islington (bot) a5303dd9c2
bpo-32857: Raise error when tkinter after_cancel() is called with None. (GH-5701)
(cherry picked from commit 74382a3f17)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
2018-03-04 04:00:33 -08:00
Miss Islington (bot) 0902a2d6b2 bpo-32981: Fix catastrophic backtracking vulns (GH-5955)
* Prevent low-grade poplib REDOS (CVE-2018-1060)

The regex to test a mail server's timestamp is susceptible to
catastrophic backtracking on long evil responses from the server.

Happily, the maximum length of malicious inputs is 2K thanks
to a limit introduced in the fix for CVE-2013-1752.

A 2KB evil response from the mail server would result in small slowdowns
(milliseconds vs. microseconds) accumulated over many apop calls.
This is a potential DOS vector via accumulated slowdowns.

Replace it with a similar non-vulnerable regex.

The new regex is RFC compliant.
The old regex was non-compliant in edge cases.

* Prevent difflib REDOS (CVE-2018-1061)

The default regex for IS_LINE_JUNK is susceptible to
catastrophic backtracking.
This is a potential DOS vector.

Replace it with an equivalent non-vulnerable regex.

Also introduce unit and REDOS tests for difflib.

Co-authored-by: Tim Peters <tim.peters@gmail.com>
Co-authored-by: Christian Heimes <christian@python.org>
Co-authored-by: Jamie Davis <davisjam@vt.edu>
(cherry picked from commit 0e6c8ee235)
2018-03-03 21:55:07 -08:00
Miss Islington (bot) a13b65422a
bpo-32964: Reuse a testing implementation of the path protocol in tests. (GH-5930)
(cherry picked from commit b21d155f57)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-03-02 02:17:51 -08:00
Miss Islington (bot) 398242a5b6 Fixed incorrect default value for dataclass unsafe_hash. (GH-5949) (GH-5950)
(cherry picked from commit 5da8cfb838)

Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
2018-03-01 08:30:13 -05:00
Miss Islington (bot) 7e5763469e
bpo-32940: IDLE: Simplify StringTranslatePseudoMapping in pyparse (GH-5862)
The new code also runs faster.
(cherry picked from commit f0daa880a4)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
2018-02-28 15:08:21 -08:00
Ned Deily b0ef5c979b Update NEWS, docs, and patchlevel for 3.7.0b2 2018-02-27 19:49:18 -05:00
Miss Islington (bot) 0ea49fc0bf
bpo-30928: Update idlelib/NEWS.txt, possibly for 3.7.0b2 (GH-5932)
(cherry picked from commit 0954c9e9c8)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2018-02-27 16:07:45 -08:00
Miss Islington (bot) b7dcae358e Revert "bpo-31961: subprocess now accepts path-like args (GH-4329)" (GH-5912) (GH-5931)
* Revert "bpo-31961: subprocess now accepts path-like args (GH-4329)"

This reverts commit dd42cb71f2.
(cherry picked from commit be50a7b627)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-02-27 18:30:30 -05:00
Miss Islington (bot) 4c842b0920
bpo-31453: Add setter for min/max protocol version (GH-5259)
OpenSSL 1.1 has introduced a new API to set the minimum and maximum
supported protocol version. The API is easier to use than the old
OP_NO_TLS1 option flags, too.

Since OpenSSL has no call to set minimum version to highest supported,
the implementation emulate maximum_version = MINIMUM_SUPPORTED and
minimum_version = MAXIMUM_SUPPORTED by figuring out the minumum and
maximum supported version at compile time.

Signed-off-by: Christian Heimes <christian@python.org>
(cherry picked from commit 698dde16f6)

Co-authored-by: Christian Heimes <christian@python.org>
2018-02-27 03:41:04 -08:00
Christian Heimes 89c2051a55
[3.7] bpo-32951: Disable SSLSocket/SSLObject constructor (GH-5864) (#5925)
Direct instantiation of SSLSocket and SSLObject objects is now prohibited.
The constructors were never documented, tested, or designed as public
constructors. The SSLSocket constructor had limitations. For example it was
not possible to enabled hostname verification except was
ssl_version=PROTOCOL_TLS_CLIENT with cert_reqs=CERT_REQUIRED.

SSLContext.wrap_socket() and SSLContext.wrap_bio are the recommended API
to construct SSLSocket and SSLObject instances. ssl.wrap_socket() is
also deprecated.

The only test case for direct instantiation was added a couple of days
ago for IDNA testing.

Signed-off-by: Christian Heimes <christian@python.org>
(cherry picked from commit 9d50ab563d)

Co-authored-by: Christian Heimes <christian@python.org>
2018-02-27 11:17:32 +01:00
Miss Islington (bot) 2614ed4c6e
bpo-32947: OpenSSL 1.1.1-pre1 / TLS 1.3 fixes (GH-5663)
* bpo-32947: OpenSSL 1.1.1-pre1 / TLS 1.3 fixes

Misc fixes and workarounds for compatibility with OpenSSL 1.1.1-pre1 and
TLS 1.3 support. With OpenSSL 1.1.1, Python negotiates TLS 1.3 by
default. Some test cases only apply to TLS 1.2. Other tests currently
fail because the threaded or async test servers stop after failure.

I'm going to address these issues when OpenSSL 1.1.1 reaches beta.

OpenSSL 1.1.1 has added a new option OP_ENABLE_MIDDLEBOX_COMPAT for TLS
1.3. The feature is enabled by default for maximum compatibility with
broken middle boxes. Users should be able to disable the hack and CPython's test suite needs
it to verify default options.

Signed-off-by: Christian Heimes <christian@python.org>
(cherry picked from commit 05d9fe32a1)

Co-authored-by: Christian Heimes <christian@python.org>
2018-02-27 00:17:49 -08:00
Miss Islington (bot) a93e3dc236 bpo-32960: For dataclasses, disallow inheriting frozen from non-frozen classes and vice-versa, (GH-5919) (GH-5920)
This restriction will be relaxed at a future date.
(cherry picked from commit 2fa6b9eae0)

Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
2018-02-26 20:59:55 -05:00
Miss Islington (bot) a9a8a9814a
bpo-32713: Fix tarfile.itn for large/negative float values. (GH-5434)
(cherry picked from commit 72d9b2be36)

Co-authored-by: Joffrey F <f.joffrey@gmail.com>
2018-02-26 16:50:09 -08:00
Miss Islington (bot) 51d95ffc2f
bpo-32222: Fix pygettext skipping docstrings for funcs with arg typehints (GH-4745)
(cherry picked from commit eee72d4778)

Co-authored-by: Tobotimus <Tobotimus@users.noreply.github.com>
2018-02-26 15:23:26 -08:00
Miss Islington (bot) 53d3f8a899
bpo-32394: Remove some TCP options on old version Windows. (GH-5523)
(cherry picked from commit 19e7d48ce8)

Co-authored-by: animalize <animalize@users.noreply.github.com>
2018-02-26 10:36:17 -08:00
Miss Islington (bot) f8a3485dcd
Revert unneccessary changes made in bpo-30296 and apply other improvements. (GH-2624)
(cherry picked from commit 3f2e6f15d6)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-02-26 08:22:24 -08:00
Miss Islington (bot) a9e0b070b3
bpo-32922: dbm.open() now encodes filename with the filesystem encoding. (GH-5832)
(cherry picked from commit 6f600ff173)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-02-26 06:25:40 -08:00
Miss Islington (bot) 4cffe2f66b bpo-32929: Dataclasses: Change the tri-state hash parameter to the boolean unsafe_hash. (GH-5891) (GH-5902)
unsafe_hash=False is now the default. It is the same behavior as the old hash=None parameter. unsafe_hash=True will try to add __hash__. If it already exists, TypeError is raised.
(cherry picked from commit dbf9cff48a)

Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
2018-02-26 04:43:35 -05:00
Miss Islington (bot) 1a5790689f
Fix 'deecorator' typo in test/test_dataclasses (GH-5899)
(cherry picked from commit 973cae07d6)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2018-02-25 19:09:05 -08:00
Miss Islington (bot) 632c1cb571
bpo-32622: Native sendfile on windows (GH-5565)
* Support sendfile on Windows Proactor event loop naively.
(cherry picked from commit a19fb3c6aa)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
2018-02-25 09:10:58 -08:00
Miss Islington (bot) b6b6669cfd Exhaustively test dataclass hashing when no hash= value is provided. This is in anticipation of changing how non-default hashing is handled. (GH-5834) (GH-5889)
(cherry picked from commit 718070db26)

Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
2018-02-25 11:56:30 -05:00
Miss Islington (bot) 83f4394e4e
Delete a broken threading.local example (GH-5870)
This code never did anything correct or useful. The class attribute will never be affected, and the condition will never be true.
(cherry picked from commit 5fb632e831)

Co-authored-by: Aaron Gallagher <habnabit@users.noreply.github.com>
2018-02-25 07:23:25 -08:00
Miss Islington (bot) ff7528f089 [3.7] bpo-31809: test secp ECDH curves (GH-4036) (#5872)
Add tests to verify connection with secp384r1 ECDH curves.
(cherry picked from commit b7b9225831)

Co-authored-by: Christian Heimes <christian@python.org>
2018-02-25 10:56:11 +01:00
Miss Islington (bot) 8fa8478dde [3.7] bpo-24334: Cleanup SSLSocket (GH-5252) (#5857)
* The SSLSocket is no longer implemented on top of SSLObject to
  avoid an extra level of indirection.
* Owner and session are now handled in the internal constructor.
* _ssl._SSLSocket now uses the same method names as SSLSocket and
  SSLObject.
* Channel binding type check is now handled in C code. Channel binding
  is always available.

The patch also changes the signature of SSLObject.__init__(). In my
opinion it's fine. A SSLObject is not a user-constructable object.
SSLContext.wrap_bio() is the only valid factory.
(cherry picked from commit 141c5e8c24)

Co-authored-by: Christian Heimes <christian@python.org>
2018-02-24 21:51:56 +01:00
Miss Islington (bot) e49bf0f353
bpo-31966: Fixed WindowsConsoleIO.write() for writing empty data. (GH-5754)
(cherry picked from commit 42c35d9c0c)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-02-24 09:39:18 -08:00
Miss Islington (bot) 46632f4d3c [3.7] bpo-32819: Simplify and improve ssl.match_hostname (GH-5620) (#5847)
ssl.match_hostname() has been simplified and no longer depends on re and
ipaddress module for wildcard and IP addresses. Error reporting for invalid
wildcards has been improved.

Signed-off-by: Christian Heimes <christian@python.org>
(cherry picked from commit aef1283ba4)

Co-authored-by: Christian Heimes <christian@python.org>
2018-02-24 15:06:46 +01:00
Miss Islington (bot) 1c37e27719 [bpo-28414] Make all hostnames in SSL module IDN A-labels (GH-5128) (GH-5843)
Previously, the ssl module stored international domain names (IDNs)
as U-labels. This is problematic for a number of reasons -- for
example, it made it impossible for users to use a different version
of IDNA than the one built into Python.

After this change, we always convert to A-labels as soon as possible,
and use them for all internal processing. In particular, server_hostname
attribute is now an A-label, and on the server side there's a new
sni_callback that receives the SNI servername as an A-label rather than
a U-label.
(cherry picked from commit 11a1493bc4)

Co-authored-by: Christian Heimes <christian@python.org>
2018-02-23 19:18:28 -08:00
Miss Islington (bot) f409c9988e
bpo-32916: IDLE: Change `str` to `code` in pyparse (GH-5830)
Adjust tests and user modules to match.
(cherry picked from commit c29c03a34a)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
2018-02-23 18:59:53 -08:00
Miss Islington (bot) 8d9d4b57ae
bpo-32838: Fix Python versions in the table of magic numbers. (GH-5658)
(cherry picked from commit 4af8fd5614)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-02-23 11:01:54 -08:00
Miss Islington (bot) 694c5e0e1f
bpo-30028: make test.support.temp_cwd() fork-safe (GH-1066)
Make test.support.temp_cwd() fork-safe. The context manager test.support.temp_cwd() no longer removes the temporary directory when executing in a process other than the parent it entered from.
If a forked child exits the context manager it won't do the cleanup.
(cherry picked from commit 33dddac00b)

Co-authored-by: Anselm Kruis <a.kruis@science-computing.de>
2018-02-22 21:39:02 -08:00
Miss Islington (bot) 24d6e3c56b Test that new_timezone can return the UTC singleton (gh-5318) (#5819)
(cherry picked from commit a049f5790e)

Co-authored-by: Paul Ganssle <pganssle@users.noreply.github.com>
2018-02-22 16:18:54 -05:00
Miss Islington (bot) e5a9b3574c
bpo-32457: Improves handling of denormalized executable path when launching Python (GH-5756)
(cherry picked from commit 48e8c82fc6)

Co-authored-by: Steve Dower <steve.dower@microsoft.com>
2018-02-22 11:15:16 -08:00
Miss Islington (bot) 01dd52fb29
bpo-32556: nt._getfinalpathname, nt._getvolumepathname and nt._getdiskusage now correctly convert from bytes. (GH-5761)
(cherry picked from commit 23ad6d0d1a)

Co-authored-by: Steve Dower <steve.dower@microsoft.com>
2018-02-22 11:02:12 -08:00
Miss Islington (bot) dfa1144582
bpo-32905: IDLE - remove unused code in pyparse module (GH-5807)
dump is similar to print but less flexible.  lastopenbracketpos is now always initialized in _study2, as was stmt_bracketing, so the class settings are not needed.  get_last_open_bracket_pos is never called.
(cherry picked from commit 451d1edaf4)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2018-02-21 22:41:41 -08:00
Miss Islington (bot) c59bc98fb2
bpo-32874: IDLE: add tests for pyparse (GH-5755)
There are no code changes other than comments and docstrings.
(cherry picked from commit c84cf6c03f)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
2018-02-21 20:09:39 -08:00
Miss Islington (bot) eed3c7af4e bpo-32604: Swap threads only if the interpreter is different. (gh-5783)
The CPython runtime assumes that there is a one-to-one relationship (for a given interpreter) between PyThreadState and OS threads. Sending and receiving on a channel in the same interpreter was causing crashes because of this (specifically due to a check in PyThreadState_Swap()). The solution is to not switch threads if the interpreter is the same.
(cherry picked from commit f53d9f2778)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
2018-02-20 17:09:41 -07:00
Miss Islington (bot) 1d927d4feb
bpo-31848: Fix broken error handling in Aifc_read.initfp() when the SSND chunk is not found (GH-5240)
Initialize self._ssnd_chunk so that aifc.Error is raised as intended,
not AttributeError.
(cherry picked from commit 80d20b918b)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2018-02-20 14:06:58 -08:00
Miss Islington (bot) a3d6c1b23b bpo-32409: Ensures activate.bat can handle Unicode contents (GH-5765)
(cherry picked from commit 6240917b77)

Co-authored-by: Steve Dower <steve.dower@microsoft.com>
2018-02-19 17:45:02 -08:00