Commit Graph

45300 Commits

Author SHA1 Message Date
Dong-hee Na caec8a0dfb
[3.8] bpo-39828: Fix json.tool to catch BrokenPipeError (GH-18779). (GH-18894)
(cherry picked from commit 700cb58730)

Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>

Automerge-Triggered-By: @vstinner
2020-03-10 01:14:08 -07:00
Miss Islington (bot) cadfe52a00
bpo-27115: Use Query subclass for IDLE editor Goto (GH-18871)
Replace tkinter tkSimpleDialog.askinteger with a standard IDLE query dialog.
The new box checks for positivity before returning.
(cherry picked from commit 363fab83b8)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2020-03-09 16:45:19 -07:00
Pablo Galindo 3ede1bc794
[3.8] bpo-39850: Add support for abstract sockets in multiprocessing (GH-18866) (GH-18876)
(cherry picked from commit 6012f30bef)
2020-03-09 14:48:03 +00:00
Miss Islington (bot) f3f0c7a108
bpo-27115: Move IDLE Query error blanking (GH-18868)
Move required blanking of error text to non-overridden entry_ok().
(Omit news item.)
(cherry picked from commit e53a3932cb)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2020-03-08 22:56:28 -07:00
Miss Islington (bot) 0687bdf5de
bpo-39517: Allow runpy.run_path() to accept path-like objects (GH-18699)
(cherry picked from commit 0911ea5c17)

Co-authored-by: Maor Kleinberger <kmaork@gmail.com>
2020-03-08 13:59:59 -07:00
Miss Islington (bot) b2e8240261
bpo-39885: IDLE context menu clears selection (GH-18859)
Since clicking to get an IDLE context menu moves the cursor,
any text selection should be and now is cleared.
(cherry picked from commit 4ca060d8ad)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2020-03-08 12:47:05 -07:00
Miss Islington (bot) a5e821c726
bpo-39852: IDLE 'Go to line' deletes selection, updates status (GH-18801)
It appears standard that moving the text insert cursor away from a selection clears the
selection.  Clearing prevents accidental deletion of a possibly off-screen bit of text.
The update is for Ln and Col on the status bar.
(cherry picked from commit 2522db11df)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2020-03-08 11:49:44 -07:00
Miss Islington (bot) 928b4dd0ed
bpo-38894: Fix pathlib.Path.glob in the presence of symlinks and insufficient permissions (GH-18815)
Co-authored-by: Matt Wozniski <mwozniski@bloomberg.net>
(cherry picked from commit eb7560a73d)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2020-03-07 10:11:24 -08:00
Serhiy Storchaka 92b72788ec
[3.8] bpo-39889: Fix unparse.py for subscript. (GH-18824). (GH-18826)
(cherry picked from commit c4928fc1a8)
2020-03-07 18:55:32 +02:00
Miss Islington (bot) 6b452ff97f
bpo-13487: Use sys.modules.copy() in inspect.getmodule() for thread safety. (GH-18786)
`list(sys.modules.items())` was apparently not immune to "dictionary
changed size during iteration" errors.

Tested internally using an integration test that has run into this a couple of times in the past two years.  With this patch applied, the test is no longer flaky.
(cherry picked from commit 85cf1d514b)

Co-authored-by: Gregory P. Smith <gps@google.com>
2020-03-04 17:04:38 -08:00
Miss Islington (bot) 0d20364b13
bpo-38597: Never statically link extension initialization code on Windows (GH-18724)
(cherry picked from commit ce3a498408)

Co-authored-by: Steve Dower <steve.dower@python.org>
2020-03-02 16:30:18 -08:00
Pablo Galindo 9ddcb914f9
[3.8] bpo-39778: Don't traverse weak-reference lists OrderedDict's tp_traverse and tp_clear (GH-18749) (GH-18756)
Objects do not own weak references to them directly through the __weakref__ list so these
do not need to be traversed by the GC.

(cherry picked from commit 0c2b509)
2020-03-02 23:55:20 +00:00
Miss Islington (bot) 43932dc1ea
bpo-39764: Make Task.get_stack accept ag_frame (GH-18669)
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
(cherry picked from commit 4482337dec)

Co-authored-by: Lidi Zheng <scallopsky@gmail.com>
2020-03-02 05:03:50 -08:00
Miss Islington (bot) f28b0c74e5
bpo-38971: Open file in codecs.open() closes if exception raised. (GH-17666)
Open issue in the BPO indicated a desire to make the implementation of
codecs.open() at parity with io.open(), which implements a try/except to
assure file stream gets closed before an exception is raised.
(cherry picked from commit 2565edec2c)

Co-authored-by: Chris A <christopher.aporta@gmail.com>
2020-03-02 00:03:08 -08:00
Pablo Galindo 12b714391e
[3.8] bpo-39815: add cached_property to all (GH-18726) (GH-18728)
Automerge-Triggered-By: @pablogsal.
(cherry picked from commit 217dce9ee6)

Co-authored-by: Hakan Çelik <hakancelik96@outlook.com>
2020-03-02 00:08:29 +00:00
Gregory P. Smith ce720d3e06
bpo-39769: Fix compileall ddir for subpkgs. (GH-18676) (GH-18718)
Fix compileall.compile_dir() ddir= behavior on sub-packages.

Fixes compileall.compile_dir's ddir parameter and compileall command
line flag `-d` to no longer write the wrong pathname to the generated
pyc file for submodules beneath the root of the directory tree being
compiled.  This fixes a regression introduced with Python 3.5.

Tests backported from GH 02673352b5, the
implementation is different due to intervening code changes.  But still
quiet simple.

Why was the bug ever introduced?  The refactoring to add parallel
execution kept the ddir -> dfile computations but discarded the results
instead of sending them to compile_file().  This fixes that.  Lack of tests
meant this went unnoticed.
2020-03-01 10:42:56 -08:00
Stefan Krah 4d7012410c
[3.8] bpo-39794: Add --without-decimal-contextvar (GH-18702)
(cherry picked from commit 815280eb16)
2020-02-29 22:16:32 +01:00
Miss Islington (bot) e4686b7979
bpo-39548: Fix handling of 'WWW-Authenticate' header for Digest Auth (GH-18338)
* bpo-39548: Fix handling of 'WWW-Authenticate' header for Digest authentication

 - The 'qop' value in the 'WWW-Authenticate' header is optional. The
   presence of 'qop' in the header should be checked before its value
   is parsed with 'split'.

Signed-off-by: Stephen Balousek <stephen@balousek.net>

* bpo-39548: Fix handling of 'WWW-Authenticate' header for Digest authentication

 - Add NEWS item

Signed-off-by: Stephen Balousek <stephen@balousek.net>

* Update Misc/NEWS.d/next/Library/2020-02-06-05-33-52.bpo-39548.DF4FFe.rst

Co-Authored-By: Brandt Bucher <brandtbucher@gmail.com>

Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
(cherry picked from commit 5e260e0fde)

Co-authored-by: Stephen Balousek <sbalousek@users.noreply.github.com>
2020-02-29 13:05:23 -08:00
Miss Islington (bot) 846ca4961d
bpo-39781: Do not jump when select in IDLE codecontext (GH-18683)
Previously, the button-up part of selecting with a mouse was treated as a click
that meant 'jump' to this line, which modified the context and undid the selection
(cherry picked from commit c705fd1e89)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2020-02-28 10:43:25 -08:00
Łukasz Langa a0e59d3b04 Python 3.8.2
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEE4/8oOcBIslwITevpsmmV4xAlBWgFAl5UQfMACgkQsmmV4xAl
 BWgxYA//aEwIvrR4cxGFfO+W83rsde2CenAJyX2LZAy4hpAUUEzhELQsu/APjz4h
 I2vmH1PoUH4bDavI+5kUBxrJtuVhHf9rX1K4wF299ETG7tl/rlKRU563GPW5ytXo
 1eSlPQyMdSTdkD8dCg23kHZ344U5rKNTS9a+QnYYNRybtiR/pXQ/oG438wzKCHD2
 gI2N3sk8siGiMomqX9VIV3qFrtoVqgAgANOt30WWuTIa1UOdU3mf/QAc2rNbEjof
 sKmZz9h9M9gImZDB+vVh58KjGHTrEv4jO6Gqepqzt9cHbiYtDEpkYYLgIZnGgMDJ
 fJIzagZ/kJdOpsSws7TjZ/vMpgcjhImJSBiUGVYFXWWQTverG2p5S8c8/SThcehF
 bxy5c5tgWobosKfvdOB624VWa6jyjsQWFhVz3HK7+jPC/YKT2KtMF3f31IaLQ4Z5
 tJsykN+4+G26TQbwLaRZL6GtMpq5lvRFoaLkjnVV5PDS71F5ZXv4hbCufK3+ONKy
 UmbQay2xk2OH4DkR2VErJqDme8t0ajSnw0wksY3qZqQOptkfde1ppH2jbLbDZU3Y
 MEgIV7CkynfuYpNBtuOfAPoVy8eMZ8v5Na2UDwqKC4ntN7IWOeTqoCnDLoON5MQK
 LF/lGRTXkG87fpOr2izGM+XYQdww3jxzShflAL5FINJ4P4jE7S0=
 =0Eqs
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQJEBAABCAAuFiEE4/8oOcBIslwITevpsmmV4xAlBWgFAl5VCKEQHGx1a2FzekBs
 YW5nYS5wbAAKCRCyaZXjECUFaI8bD/9oqhsfi9A1JlsAIy0D3pZdYfRWebC/DUT0
 S7FkNuxIQpPPE9Ck/Paqsa/KCzUycTRYnZMh3Qkw/3wHuss8OKs1R0IsSBG2RFH/
 udefn8nzE8/rs9HgghF4qbDYokB5KO+lCJYxZzHyRs6y2QVtfzNnw9F6FYK0+CmG
 xZOFqLagYDE3MZlvRMjONgTp3+57pLTxqSM3K0mWgFFfgWZu9aZoYD0+E805eV8o
 tZPUgFgfvN/SZO9gBdW1XsPOTTgmhANt55PoMFVZ9GqQu06Qj5E8n6coD1uzZB49
 CBey5b19lSCmeEiSBJcSyg4Qha9RHPWcBwC5DGWtFzXfHpwe3UHfdF1gzpPx0+R6
 oZAOJ3/OrBJVmu66vjJhs2T1Vk565bX+V83Up/LgHe69353Fc8YILi19emxJhVOY
 CKUE2cvBoGfKCVJd/w+hiJO+ypR/1BOqVxivOQdPAoF2xFYp2q36BAddR5Gfz86w
 WZDf6hPjoKtcD3zSnyRDXf+fXeOTLl256Vzg11kSRdnsdsH5JkVAwjXTqxoTKTaA
 Hm3gmzH8PcMoVSi+pUJ1GZc8643z+QE21JDAbrOVzmTqz8qFSDfD8l5rM4bCi5m2
 ha9l3wOYunodBjAyisN8KQ0xfdTN/jtlzP4RYfAo2EbCGUK68iJ0CaP23I4+c31c
 rboFtgPqBw==
 =a8qT
 -----END PGP SIGNATURE-----

Merge tag 'v3.8.2' into 3.8

Python 3.8.2
2020-02-25 12:44:31 +01:00
Miss Islington (bot) daef21ce7d
bpo-30566: Fix IndexError when using punycode codec (GH-18632)
Trying to decode an invalid string with the punycode codec
shoud raise UnicodeError.

(cherry picked from commit ba22e8f174)

Co-authored-by: Berker Peksag <berker.peksag@gmail.com>
2020-02-25 06:42:39 +03:00
Łukasz Langa 7b3ab5921f
Python 3.8.2 2020-02-24 22:36:25 +01:00
Miss Islington (bot) 45cc9ce4de
Give proper credit for figuring out and writing PEP-3118 tests. (GH-18644) (#18646)
(cherry picked from commit b942ba03b8)

Authored-by: Stefan Krah <skrah@bytereef.org>
2020-02-24 12:44:06 +01:00
Miss Islington (bot) c97fc564a6
bpo-39649: Remove obsolete check for `__args__` in bdb.Bdb.format_stack_entry (GH-18531)
Appears to be obsolete since 75bb54c3d8.

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
(cherry picked from commit 4015d1cda3)

Co-authored-by: Daniel Hahler <git@thequod.de>
2020-02-23 19:33:07 -08:00
Miss Islington (bot) b19f7ecfa3
bpo-39681: Fix C pickle regression with minimal file-like objects (GH-18592) (#18630)
Fix a regression where the C pickle module wouldn't allow unpickling from a
file-like object that doesn't expose a readinto() method.
(cherry picked from commit 9f37872e30)

Co-authored-by: Antoine Pitrou <antoine@python.org>

Co-authored-by: Antoine Pitrou <pitrou@free.fr>
2020-02-23 23:53:24 +01:00
Miss Islington (bot) 0c1827e70c
bpo-39382: Avoid dangling object use in abstract_issubclass() (GH-18530)
Hold reference of __bases__ tuple until tuple item is done with, because by
dropping the reference the item may be destroyed.
(cherry picked from commit 1c56f8ffad)

Co-authored-by: Yonatan Goldschmidt <yon.goldschmidt@gmail.com>
2020-02-22 05:34:06 -08:00
Miss Islington (bot) b6271025c6
bpo-39576: Prevent memory error for overly optimistic precisions (GH-18581) (#18584)
(cherry picked from commit 90930e6545)

Authored-by: Stefan Krah <skrah@bytereef.org>
2020-02-21 02:16:42 +01:00
Miss Islington (bot) 44c690112d
bpo-39572: Document ’total’ flag of TypedDict (GH-18554)
(cherry picked from commit ab6423fe2d)

Co-authored-by: ananthan-123 <ananthakrishnan15.2001@gmail.com>
2020-02-18 21:24:51 -08:00
Miss Islington (bot) d77e77116f
bpo-39555: Fix distutils test to handle _d suffix on Windows debug build (GH-18357) (GH-18548)
https://bugs.python.org/issue39555

Co-authored-by: Steve Dower <steve.dower@python.org>

(cherry picked from commit ab0d892288)
2020-02-18 22:39:19 +01:00
Miss Islington (bot) 5bf58cef15
bpo-39432: Implement PEP-489 algorithm for non-ascii "PyInit_*" symbol names in distutils (GH-18150) (GH-18546)
Make it export the correct init symbol also on Windows.

https://bugs.python.org/issue39432
(cherry picked from commit 9538bc9185)

Co-authored-by: Stefan Behnel <stefan_ml@behnel.de>
2020-02-18 14:14:43 +01:00
Łukasz Langa e40b7dc63b Python 3.8.2rc2
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEE4/8oOcBIslwITevpsmmV4xAlBWgFAl5LF7QACgkQsmmV4xAl
 BWjSog/9HCurfAaWfef71g8J7Mso8ITHKTu/jHWb2Duv+olySU2HC+NohxS4ZD+W
 kWsEGbFXavop2bgGXx+I5nEqY3dJ6v6KUQfbp5q/+Gn3WuUguSS0az86r4oBlHSq
 NJmLcQ6+MTq3k3seXJkiv/OmCtMPlgXQZ/n4X6BSRWRiLeD1CRPAdm1zeBpB65HB
 XtIlpKktIMl3fMxFlx9de/ZYG8xC10ZwxjNFmO0ZW5CFsqeMf45rN9+j2T6N8W8e
 0diV2UcLmNyG9asdqT2h6d/HB9qBScAK5yrP3Ivt9MneOrKSJW2VJGh0XWNlN6VM
 wN8keuKq0o+hz+U49vVJJTGLOLzn/etiJNGrhMacfdpfV1Ycu548sf1JHwfj/L/Y
 1YCbsEE8JTTluXUGkZedLDskCaZPKSrI1nySseZPlAIqaVkJHWSzAOzKidRaTV/Q
 FB3cRDYEa0eH9HqTCtAedN4Uwhwev2Yufh9NZ9oFWh7TI9QgX7WX0p92Ho7IrnEd
 NKdrmqL6nuJ/19yz63wHzXI/F4pc7+eFmUwv8Nlp+SnmywpqgTKEyzEI4It3Y4eC
 fGmGQkpWGWULkGDyEvX1ghphss/xQjeO3JeabP7rTZUxQQA8bT+l5DsIgiwiw9sj
 3FOFDwuHOPycSBovKPq9B14r0nypsHsysNfKtGWRu+HbOohUZDw=
 =F4Ea
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQJEBAABCAAuFiEE4/8oOcBIslwITevpsmmV4xAlBWgFAl5L0eUQHGx1a2FzekBs
 YW5nYS5wbAAKCRCyaZXjECUFaO9pEACgl8zL3+wA/sSNeqoAYVkA34bZ/JsKucOS
 y4na9Z0lFogV8OMeMNbIXeU0gLgkvn+EY3kPMn5NcUxQBKdiBiYsSanuaAjWMLPI
 w03uNpW6yTcMEnSZS+GHnXQT2bmofW3ORXxzEscgSaDf42AeJPuJdM/PZqG/pC3m
 tWma/XTqXMDwBm9cILFY0aI4o1NPZadtEDWIIwzYMMF8HbsuPsDR2cOoF/e79Ylc
 /Z3BCO1Vw0/GrXF3zC8l5uLallOXVoCKjRkDS9WfrrzCJ/94fTIdQpj6lUOn1dHU
 UPimdq9yPPTVqdmkLMMIv3d/GashIVTbvl1W3VT9yVNz5EqpEu3YIo05dMuTXTPa
 x1KAoq2VEB5J72rZ99k1NgB2L/k9CAoARznmH/NZTpqOW2Dd9eiGrxq1fWJjPJYC
 wW8LRqTSeUGcdluICt++UjtiMVnHeqUT3vlm0saCMdlOyfxqq20vA7sXJ3SvcjnJ
 hBOnX6R9Nur6Umwfs+Rsh0pvDpU4ljLCcWlFtESI5wJaQ/vM1a6OL9xcv5o0u+/t
 FmJdAZ4xfdUUF0itDRCC7+L2X62SJEHb6BCww6iVRgBu7w7BV+iK9l8CGWqGWqXD
 hnXgK6xbI0B1Nus3aQH/EFHxsNQRX19mScmOpbcOile+QdZ9F/sWqvoNxPKr+fDU
 FtpUX24PzQ==
 =5hsP
 -----END PGP SIGNATURE-----

Merge tag 'v3.8.2rc2' into 3.8

Python 3.8.2rc2
2020-02-18 13:00:35 +01:00
Miss Islington (bot) e412cbba52
[3.8] bpo-39546: argparse: Honor allow_abbrev=False for specified prefix_chars (GH-18337) (GH-18543)
When `allow_abbrev` was first added, disabling the abbreviation of
long options broke the grouping of short flags ([bpo-26967](https://bugs.python.org/issue26967)).  As a fix,
b1e4d1b603 (contained in v3.8) ignores `allow_abbrev=False` for a
given argument string if the string does _not_ start with "--"
(i.e. it doesn't look like a long option).

This fix, however, doesn't take into account that long options can
start with alternative characters specified via `prefix_chars`,
introducing a regression: `allow_abbrev=False` has no effect on long
options that start with an alternative prefix character.

The most minimal fix would be to replace the "starts with --" check
with a "starts with two prefix_chars characters".  But
`_get_option_tuples` already distinguishes between long and short
options, so let's instead piggyback off of that check by moving the
`allow_abbrev` condition into `_get_option_tuples`.





https://bugs.python.org/issue39546
(cherry picked from commit 8edfc47bae)


Co-authored-by: Kyle Meyer <kyle@kyleam.com>


https://bugs.python.org/issue39546



Automerge-Triggered-By: @encukou
2020-02-18 03:14:07 -08:00
Miss Islington (bot) 7fd752c1bc
bpo-39663: IDLE: Add additional tests for pyparse (GH-18536)
Test when find_good_parse_start should return 0.

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
(cherry picked from commit ffda25f6b8)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
2020-02-17 19:05:39 -08:00
Łukasz Langa 777ba072d6
Python 3.8.2rc2 2020-02-17 23:45:14 +01:00
Dong-hee Na f64abd1056
[3.8] bpo-39453: Fix contains method of list to hold strong references (GH-18204) 2020-02-17 10:13:52 +01:00
Senthil Kumaran ea316fd215
Revert "[3.8] bpo-27657: Fix urlparse() with numeric paths (GH-16839)" (GH-18525)
This reverts commit 0f3187c1ce.

The change broke the backwards compatibility of parsing behavior in a
patch release of Python (3.8.1). A decision was taken to revert this
patch in 3.8.2.

In https://bugs.python.org/issue27657 it was decided that the previous
behavior like

>>> urlparse('localhost:8080')
ParseResult(scheme='', netloc='', path='localhost:8080', params='', query='', fragment='')

>>> urlparse('undefined:8080')
ParseResult(scheme='', netloc='', path='undefined:8080', params='', query='', fragment='')

needs to be preserved in patch releases as number of users rely upon it.

Explicitly mention the releases involved with the revert in NEWS.
Adopt the wording suggested by @ned-deily.
2020-02-16 13:47:21 -08:00
Miss Islington (bot) 8dbdf5f275
[3.8] bpo-39606: allow closing async generators that are already closed (GH-18475) (GH-18501)
The fix for [bpo-39386](https://bugs.python.org/issue39386) attempted to make it so you couldn't reuse a
agen.aclose() coroutine object. It accidentally also prevented you
from calling aclose() at all on an async generator that was already
closed or exhausted. This commit fixes it so we're only blocking the
actually illegal cases, while allowing the legal cases.

The new tests failed before this patch. Also confirmed that this fixes
the test failures we were seeing in Trio with Python dev builds:
  https://github.com/python-trio/trio/pull/1396


https://bugs.python.org/issue39606
(cherry picked from commit 925dc7fb1d)


Co-authored-by: Nathaniel J. Smith <njs@pobox.com>


https://bugs.python.org/issue39606



Automerge-Triggered-By: @njsmith
2020-02-13 00:43:23 -08:00
Steve Dower a00b5be5f7
bpo-39184: Add audit events to functions in `fcntl`, `msvcrt`, `os`, `resource`, `shutil`, `signal`, `syslog` (GH-18407)
Co-authored-by: Saiyang Gou <gousaiyang@163.com>
2020-02-13 08:30:27 +00:00
Miss Islington (bot) 2076d4f97e
bpo-39474: Fix AST pos for expressions like (a)(b), (a)[b] and (a).b. (GH-18477)
(cherry picked from commit 6e619c48b8)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2020-02-12 12:56:44 -08:00
Miss Islington (bot) ac6f4d2db7
bpo-21016: pydoc and trace use sysconfig (GH-18476)
bpo-21016, bpo-1294959: The pydoc and trace modules now use the
sysconfig module to get the path to the Python standard library, to
support uncommon installation path like /usr/lib64/python3.9/ on
Fedora.

Co-Authored-By: Jan Matějek <jmatejek@suse.com>
(cherry picked from commit 4fac7ed43e)

Co-authored-by: Victor Stinner <vstinner@python.org>
2020-02-12 04:32:52 -08:00
Miss Islington (bot) efd878cdb4
bpo-39219: Fix SyntaxError attributes in the tokenizer. (GH-17828)
* Always set the text attribute.
* Correct the offset attribute for non-ascii sources.
(cherry picked from commit 0cc6b5e559)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2020-02-12 02:35:10 -08:00
Miss Islington (bot) ed4d263e87
bpo-39595: Improve zipfile.Path performance (GH-18406) (GH-18472)
* Improve zipfile.Path performance on zipfiles with a large number of entries.

* 📜🤖 Added by blurb_it.

* Add bpo to blurb

* Sync with importlib_metadata 1.5 (6fe70ca)

* Update blurb.

* Remove compatibility code

* Add stubs module, omitted from earlier commit

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
(cherry picked from commit e5bd73632e)

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
2020-02-11 22:21:32 -05:00
Miss Islington (bot) d3f9fb2d28
bpo-39299: Add more tests for mimetypes and its cli. (GH-17949)
* Add tests for case insensitive check of types and extensions as fallback.
* Add tests for data url with no comma.
* Add tests for read_mime_types.
* Add tests for the mimetypes cli and refactor __main__ code to private function.
* Restore mimetypes.knownfiles value at the end of the test.
(cherry picked from commit d8efc14951)

Co-authored-by: Karthikeyan Singaravelan <tir.karthi@gmail.com>
2020-02-11 07:32:40 -08:00
Łukasz Langa 2cceef562a Python 3.8.2rc1
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEE4/8oOcBIslwITevpsmmV4xAlBWgFAl5BvZEACgkQsmmV4xAl
 BWhElA/+JjXT0JFCuPp3BfRO4U0MMSxYalgLzvIa3VVMcH1botZWJk2Hn5S3UZNu
 kaay08L0A0cFqU/Wly+RPmQRNOCwDbByHJWpDVKKoBGvR6jQYsDI7RQ4DXjdij8P
 CRSsgfIqt+3JoAvYkcbW8R/qdMQr9mNAdEvZimoV9ZnToP6RA6byPdwpcllNaXOe
 IxSMEPVHhsn6OvfA9B7c6lKa021lDqmDnk1/uA4rukkI7vJcClXaiMgogwFM/hct
 hcU1FfT2l7d9JawrGiv+zHJRs7KBD9f+pBsco6FBbijwlQ7aXKEoWfGWKvWUz2Fw
 GxH4h8i2mjvkfraARJdoHyc39CgGYqFPTBrwJC1KA4zs2KfDuhNzYuWMsXirdT6p
 IglBQ2pJ5kIxdItrhOAw9CpbxZmAIR8uSTzbWdKQRsPviQouURh/nTRpKeNErviM
 UkN1TNdS1zixjCE/6EG04nrEjjJr2/lmvKZ0Y+nGcYKrTXLJt1WKWCgwjBnv+t7i
 nNp3HqMmcekkX2pOIhHKn+zUhcl/bMax8tg9Q0+sAxSsVedA3PZDucVC43sv+1uY
 pbm8dXesCWE9bkDpNkeG06IYA/HHv1YB4l698MLC9of0vvAEWcqobArHwSm8+7bk
 Gz8EnSjEIQEeNAOS76yVAk0G4Go1kdvEgpsl5G0WovwepEVPINs=
 =sBHh
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQJEBAABCAAuFiEE4/8oOcBIslwITevpsmmV4xAlBWgFAl5CoCQQHGx1a2FzekBs
 YW5nYS5wbAAKCRCyaZXjECUFaIwsD/9ADDbV8PiyJV2BKOrGH14oGDQcOj/qU4ZT
 UJEJhCe0jHW/6fhk031lveKYeOwnuWu9h56JP5VfhnoRZEeFv8aY+i2xk4wEgzpA
 a+Ts2ZPIWFx4NDboBxhlxE4Dt1HhmvLUBM63dyH9fqMFHHagdnpwLkSWI2yFGK5u
 wVdfmO351G0PE9KUCD8QQOE802LfCoJbUo7Q1H20BqfxuUlLzm6VWDZzgjyLIgCV
 bXeu37rKDuoFo8hlsON42rI0OVQAso2CMLvdp/Q98cj8oqcpQ/RJZ2wfJ2CzmFy4
 fNi4dluQXGkkx+V6SLpFmRkNH1FEAHfz5Ha0p/V18mCwsWR3kgcWZ/UnUhm6RDsl
 2lHhURMdkDhgEHYFgeB51ZxnuogJ02uGixEUKjDecizadzd1BBpGZALMU8jIiRKC
 l5u+aMSbC2RyT84EyRAlb748g55x7bdGcE+axwyhxOF0gik4cGoDaF5wcnz3MSrT
 BjXmQ3gp/Z2vw95bmZ6UBHn/NCaZInsEMiscCwm/UwI54/qCwrh2UTIdkPEX+4zm
 C+g26Ypq/f8Ki9SXQlrCg8JFRDpKCBS94/L1f+enQgWO7Na5wtSNdDvMsroaDqqH
 MgZFjuUz7dI38xXRoUa1Jz+PQRAziB4qAF44f87gL7rHkZySX9lgKj8H+19kH0dZ
 SmAF5q6J3w==
 =6Yin
 -----END PGP SIGNATURE-----

Merge tag 'v3.8.2rc1' into 3.8

Python 3.8.2rc1
2020-02-11 13:37:54 +01:00
Miss Islington (bot) c372f9b9e7
bpo-39600: Adjust code, add idlelib/NEWS item (GH-18449)
Complete previous patch.
(cherry picked from commit 96ce227067)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2020-02-10 17:27:31 -08:00
Miss Islington (bot) 021a5694ed
bpo-39600, IDLE: Remove duplicated font names (GH-18430)
In the font configuration window, remove duplicated font names.
(cherry picked from commit ed335cf53b)

Co-authored-by: Victor Stinner <vstinner@python.org>
2020-02-10 13:38:30 -08:00
Łukasz Langa 8623e68ea8
Python 3.8.2rc1 2020-02-10 20:08:24 +01:00
Miss Islington (bot) dc56f5f488 bpo-39590: make deque.__contains__ and deque.count hold strong references (GH-18421) (GH-18423)
(cherry picked from commit c6dedde160)

Co-authored-by: sweeneyde <36520290+sweeneyde@users.noreply.github.com>

Co-authored-by: sweeneyde <36520290+sweeneyde@users.noreply.github.com>
2020-02-09 00:39:28 -08:00
Lysandros Nikolaou 8b9cebce09
[3.8] bpo-39579: Fix Attribute end_col_offset to point at the current node (GH-18405) (GH-18408)
(cherry picked from commit d2e1098641)





https://bugs.python.org/issue39579



Automerge-Triggered-By: @gvanrossum
2020-02-07 16:21:38 -08:00
Miss Islington (bot) 0d03a10282
bpo-39274: Ensure Fraction.__bool__() returns a bool (GH-18017)
Some numerator types used (specifically NumPy) decides to not
return a Python boolean for the "a != b" operation. Using the equivalent
call to bool() guarantees a bool return also for such types.
(cherry picked from commit 427c84f13f)

Co-authored-by: Sebastian Berg <sebastian@sipsolutions.net>
2020-02-06 07:13:38 -08:00
Miss Islington (bot) 708f472dd9
bpo-38149: Call sys.audit() only once per call for glob.glob(). (GH-18360)
(cherry picked from commit 54b4f14712)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2020-02-06 00:45:18 -08:00
Miss Islington (bot) 927d3aab1c
bpo-39505: delete the redundant '/' in $env:VIRTUAL_ENV (GH-18290) (GH-18359)
(cherry picked from commit 787b6d548c)

Co-authored-by: schwarzichet <15522755+schwarzichet@users.noreply.github.com>
2020-02-05 08:39:36 +00:00
Miss Islington (bot) 3498ac55bc
bpo-39184: Add audit events to command execution functions in os and pty modules (GH-17824)
(cherry picked from commit 95f6001021)

Co-authored-by: Saiyang Gou <gousaiyang@163.com>
2020-02-04 16:32:32 -08:00
Miss Islington (bot) 30e769382d
closes bpo-39510: Fix use-after-free in BufferedReader.readinto() (GH-18295)
When called on a closed object, readinto() segfaults on account
of a write to a freed buffer:

    ==220553== Process terminating with default action of signal 11 (SIGSEGV): dumping core
    ==220553==  Access not within mapped region at address 0x2A
    ==220553==    at 0x48408A0: memmove (vg_replace_strmem.c:1272)
    ==220553==    by 0x58DB0C: _buffered_readinto_generic (bufferedio.c:972)
    ==220553==    by 0x58DCBA: _io__Buffered_readinto_impl (bufferedio.c:1053)
    ==220553==    by 0x58DCBA: _io__Buffered_readinto (bufferedio.c.h:253)

Reproducer:

    reader = open ("/dev/zero", "rb")
    _void  = reader.read (42)
    reader.close ()
    reader.readinto (bytearray (42)) GH-GH-GH- BANG!

The problem exists since 2012 when commit dc469454ec added code
to free the read buffer on close().

Signed-off-by: Philipp Gesang <philipp.gesang@intra2net.com>
(cherry picked from commit cb1c0746f2)

Co-authored-by: Philipp Gesang <phg@phi-gamma.net>
2020-02-04 13:41:55 -08:00
Miss Islington (bot) 9a740b6c7e
bpo-37224: Improve test__xxsubinterpreters.DestroyTests (GH-18058)
Adds an additional assertion check based on a race condition for `test__xxsubinterpreters.DestroyTests.test_still_running` discovered in the bpo issue.

https://bugs.python.org/issue37224
(cherry picked from commit f03a8f8d50)

Co-authored-by: Kyle Stanley <aeros167@gmail.com>
2020-02-04 07:31:19 -08:00
Miss Islington (bot) a0389ba84b
Fixes in sorting descriptions (GH-18317)
Improvements in listsort.txt and a comment in sortperf.py.

Automerge-Triggered-By: @csabella
(cherry picked from commit 24e5ad4689)

Co-authored-by: Stefan Pochmann <stefan.pochmann@gmail.com>
2020-02-03 16:50:29 -08:00
Miss Islington (bot) 02395fad8e
bpo-39450 Stripped whitespace before parsing the docstring in TestCase.shortDescription (GH-18175) (#18323)
(cherry picked from commit 032de7324e)

Co-authored-by: Steve Cirelli <scirelli+git@gmail.com>
2020-02-03 08:20:41 +00:00
Antoine Pitrou 1723687339
[3.8] bpo-39492: Fix a reference cycle between reducer_override and a Pickler instance (GH-18266) (#18316)
https://bugs.python.org/issue39492

Automerge-Triggered-By: @pitrou
(cherry picked from commit 0f2f35e)

Co-authored-by: Pierre Glaser <pierreglaser@msn.com>
2020-02-02 21:22:57 +01:00
Miss Islington (bot) 83d3202b92
bpo-38792: Remove IDLE shell calltip before new prompt. (GH-17150)
Previously, a calltip might be left after SyntaxError, KeyboardInterrupt, or Shell Restart.

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Co-authored-by: Tal Einat <taleinat+github@gmail.com>
(cherry picked from commit bfdeaa37b3)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2020-01-30 18:14:16 -08:00
Miss Islington (bot) b841633cc2
bpo-39502: Skip test_zipfile.test_add_file_after_2107() on AIX (GH-18282)
Skip test_zipfile.test_add_file_after_2107() if time.localtime()
fails with OverflowError. It is the case on AIX 6.1 for example.
(cherry picked from commit c232c9110c)

Co-authored-by: Victor Stinner <vstinner@python.org>
2020-01-30 07:05:08 -08:00
Miss Islington (bot) 58076df0c5
bpo-39493: Fix definition of IO.closed in typing.py (GH-18265)
(cherry picked from commit 2e6569b669)

Co-authored-by: Shantanu <hauntsaninja@users.noreply.github.com>
2020-01-29 21:42:38 -08:00
Miss Islington (bot) 696d2324cf
bpo-39485: fix corner-case in method-detection of mock (GH-18255)
Replace check for whether something is a method in the mock module. The
previous version fails on PyPy, because there no method wrappers exist
(everything looks like a regular Python-defined function). Thus the
isinstance(getattr(result, '__get__', None), MethodWrapperTypes) check
returns True for any descriptor, not just methods.

This condition could also return erroneously True in CPython for
C-defined descriptors.

Instead to decide whether something is a method, just check directly
whether it's a function defined on the class. This passes all tests on
CPython and fixes the bug on PyPy.
(cherry picked from commit a327677905)

Co-authored-by: Carl Friedrich Bolz-Tereick <cfbolz@gmx.de>

Co-authored-by: Carl Friedrich Bolz-Tereick <cfbolz@gmx.de>
2020-01-29 16:15:36 +00:00
Miss Islington (bot) 2b675f0c8f
bpo-39460: Fix test_zipfile.test_add_file_after_2107() (GH-18247)
XFS filesystem is limited to 32-bit timestamp, but the utimensat()
syscall doesn't fail. Moreover, there is a VFS bug which returns
a cached timestamp which is different than the value on disk.

https://bugzilla.redhat.com/show_bug.cgi?id=1795576
https://bugs.python.org/issue39460GH-msg360952
(cherry picked from commit 3cb49b62e6)

Co-authored-by: Victor Stinner <vstinner@python.org>
2020-01-29 06:41:49 -08:00
Miss Islington (bot) dbb37aac14
bpo-39439: Fix multiprocessing spawn path in a venv on Windows (GH-18158)
(cherry picked from commit 0be3246d4f)

Co-authored-by: Adam Meily <ameily@users.noreply.github.com>
2020-01-28 02:52:47 -08:00
Miss Islington (bot) 595b516965
bpo-38883: Don't use POSIX `$HOME` in `pathlib.Path.home/expanduser` on Windows (GH-17961)
In bpo-36264 os.path.expanduser was changed to ignore HOME on Windows.

Path.expanduser/home still honored HOME despite being documented as behaving the same
as os.path.expanduser. This makes them also ignore HOME so that both implementations
behave the same way again.
(cherry picked from commit c45a2aa9e2)

Co-authored-by: Christoph Reiter <reiter.christoph@gmail.com>
2020-01-28 01:59:43 -08:00
mbarkhau cf9d005547 [3.8] bpo-39390 shutil: fix argument types for ignore callback (GH-18122) 2020-01-28 00:46:29 +01:00
Miss Islington (bot) 7b57b15bd8
bpo-30780: Add IDLE configdialog tests (GH-3592)
Expose dialog buttons to test code and complete their test coverage.
Complete test coverage for highlights and keys tabs.

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
(cherry picked from commit dd023ad161)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
2020-01-27 14:35:08 -08:00
Matthew Kokotovich 19be85c765 [3.8] bpo-39082: Allow AsyncMock to correctly patch static/class methods (GH-18190)
(cherry picked from commit 62865f4532)

Co-authored-by: Matthew Kokotovich <mkokotovich@gmail.com>
2020-01-26 15:30:27 +00:00
Miss Islington (bot) a5906b2bfc bpo-38473: Handle autospecced functions and methods used with attach_mock (GH-16784) (GH-18167)
If an autospecced object is attached using attach_mock the
child would be a function with mock object as attribute from
which signature has to be derived.

(cherry picked from commit 66b00a9d3a)

Co-authored-by: Karthikeyan Singaravelan <tir.karthi@gmail.com>
2020-01-25 20:23:08 +05:30
Miss Islington (bot) a234492854
bpo-39388: IDLE: Fix bug when cancelling out of configdialog (GH-18068)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
(cherry picked from commit d0d9fa8c5e)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
2020-01-25 01:17:54 -08:00
Miss Islington (bot) ea4a61fec8
bpo-39430: Fix race condition in lazy imports in tarfile. (GH-18161)
Use `from ... import ...` to ensure module is fully loaded before accessing its attributes.
(cherry picked from commit 9017e0bd5e)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2020-01-24 12:10:42 -08:00
Miss Islington (bot) 0ea7309927
Improve test coverage for AsyncMock. (GH-17906)
* Add test for nested async decorator patch.
* Add test for side_effect and wraps with a function.
* Add test for side_effect with an exception in the iterable.
(cherry picked from commit 54f743eb31)

Co-authored-by: Karthikeyan Singaravelan <tir.karthi@gmail.com>
2020-01-24 05:27:04 -08:00
Miss Islington (bot) a46728a570
bpo-39426: Fix outdated default and highest protocols in docs (GH-18154)
Some portions of the pickle documentation hadn't been updated for the pickle protocol changes in Python 3.8 (new protocol 5, default protocol 4). This PR fixes those docs.

https://bugs.python.org/issue39426
(cherry picked from commit e9652e8d58)

Co-authored-by: Mark Dickinson <mdickinson@enthought.com>
2020-01-24 02:20:35 -08:00
Alex Rebert 5654f83b97 [3.8] bpo-35182: fix communicate() crash after child closes its pipes (GH-18117) (GH-18148)
When communicate() is called in a loop, it crashes when the child process
has already closed any piped standard stream, but still continues to be running

Co-authored-by: Andriy Maletsky <andriy.maletsky@gmail.com>.
(cherry picked from commit d3ae95e1e9)

Co-authored-by: Alex Rebert <alex@forallsecure.com>





https://bugs.python.org/issue35182
2020-01-23 15:31:29 -08:00
Miss Islington (bot) 993811ffe7
bpo-39421: Fix posible crash in heapq with custom comparison operators (GH-18118)
* bpo-39421: Fix posible crash in heapq with custom comparison operators

* fixup! bpo-39421: Fix posible crash in heapq with custom comparison operators

* fixup! fixup! bpo-39421: Fix posible crash in heapq with custom comparison operators
(cherry picked from commit 79f89e6e5a)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2020-01-23 07:22:25 -08:00
Miss Islington (bot) 545fc51d95
bpo-32989: IDLE - remove unneeded parameter (GH-18138)
IDLE does not pass a non-default _synchre in any of its calls to
pyparse.find_good_parse_start.
(cherry picked from commit f9e07e116c)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2020-01-22 21:13:41 -08:00
Miss Islington (bot) 3b7618809d
bpo-39050: The Help button in IDLE's config menu works again (GH-17611)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
(cherry picked from commit 2e43b64c94)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2020-01-22 20:13:29 -08:00
Victor Stinner f4e3e1c4d4
Move test_math tests (GH-18098) (GH-18102)
testPerm() and testComb() belong to MathTests, not to IsCloseTests().

(cherry picked from commit 59e2d26b25)
2020-01-21 15:04:33 +01:00
Miss Islington (bot) ab0d8e356e
bpo-39389: gzip: fix compression level metadata (GH-18077)
As described in RFC 1952, section 2.3.1, the XFL (eXtra FLags) byte of a
gzip member header should indicate whether the DEFLATE algorithm was
tuned for speed or compression ratio. Prior to this patch, archives
emitted by the `gzip` module always indicated maximum compression.
(cherry picked from commit eab3b3f1c6)

Co-authored-by: William Chargin <wchargin@gmail.com>
2020-01-21 03:42:49 -08:00
Miss Islington (bot) 060ad2fc15
bpo-32989: IDLE - fix bad editor call of pyparse method (GH-5968)
Fix comments and add tests for editor newline_and_indent_event method.
Remove unused None default for function parameter of pyparse find_good_parse_start method
and code triggered by that default.

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
(cherry picked from commit ec64640a2c)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
2020-01-21 02:29:39 -08:00
Miss Islington (bot) 5cadd3fe3a
bpo-39386: Prevent double awaiting of async iterator (GH-18081)
(cherry picked from commit a96e06db77)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
2020-01-20 15:06:40 -08:00
Miss Islington (bot) c7b16f8588
Fix typo from base to based (GH-18055)
(cherry picked from commit 558f078911)

Co-authored-by: Michael Haas <micha2718l@gmail.com>
2020-01-19 02:48:04 -08:00
Miss Islington (bot) 9f220e4968
Fix documentation in code.py (GH-17988)
(cherry picked from commit b4cdb3f60e)

Co-authored-by: Kyle Pollina <kylepollina@protonmail.com>
2020-01-14 12:13:59 -08:00
Karthikeyan Singaravelan 9955f33cdb [3.8] bpo-39033: Fix NameError in zipimport during hash validation (GH-17588) (GH-17642)
Fix `NameError` in `zipimport` during hash validation and add a regression test.

(cherry picked from commit 79f02fee1a)



https://bugs.python.org/issue39033
2020-01-14 03:39:19 -08:00
Miss Islington (bot) 3043ec7d6a
bpo-38293: Allow shallow and deep copying of property objects (GH-16438)
Copying property objects results in a TypeError. Steps to reproduce:

```
>>> import copy
>>> obj = property()
>>> copy.copy(obj)
````

This affects both shallow and deep copying.
My idea for a fix is to add property objects to the list of "atomic" objects in the copy module.
These already include types like functions and type objects.

I also added property objects to the unit tests test_copy_atomic and test_deepcopy_atomic. This is my first PR, and it's highly likely I've made some mistake, so please be kind :)

https://bugs.python.org/issue38293
(cherry picked from commit 9f3fc6c5b4)

Co-authored-by: Guðni Natan Gunnarsson <1493259+GudniNatan@users.noreply.github.com>
2020-01-12 10:04:18 -08:00
Miss Islington (bot) eb9ba2f66d bpo-16575: Disabled checks for union types being passed by value. (GH-17960) (GH-17964)
Although the underlying libffi issue remains open, adding these
checks have caused problems in third-party projects which are in
widespread use. See the issue for examples.

The corresponding tests have also been skipped.

(cherry picked from commit c12440c371)
2020-01-12 11:41:07 +00:00
Miss Islington (bot) 33dd75a28f
bpo-38356: Fix ThreadedChildWatcher thread leak in test_asyncio (GH-16552)
Motivation for this PR (comment from @vstinner in bpo issue):
```
Warning seen o AMD64 Ubuntu Shared 3.x buildbot:
https://buildbot.python.org/all/GH-/builders/141/builds/2593

test_devnull_output (test.test_a=syncio.test_subprocess.SubprocessThreadedWatcherTests) ...
Warning -- threading_cleanup() failed to cleanup 1 threads (count: 1, dangling: 2)
```
The following implementation details for the new method are TBD:

1) Public vs private

2) Inclusion in `close()`

3) Name

4) Coroutine vs subroutine method

5) *timeout* parameter

If it's a private method, 3, 4, and 5 are significantly less important.

I started with the most minimal implementation that fixes the dangling threads without modifying the regression tests, which I think is particularly important. I typically try to avoid directly modifying existing tests as much as possible unless it's necessary to do so. However, I am open to changing any part of this.

https://bugs.python.org/issue38356
(cherry picked from commit 0ca7cc7fc0)

Co-authored-by: Kyle Stanley <aeros167@gmail.com>
2020-01-12 03:21:00 -08:00
Miss Islington (bot) 98b1c0c7ac bpo-39297: Update for importlib_metadata 1.4. (GH-17947) (GH-17952)
* bpo-39297: Update for importlib_metadata 1.4. Includes performance updates.

* 📜🤖 Added by blurb_it.

* Update blurb

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
(cherry picked from commit 136735c1a2)

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
2020-01-11 10:56:57 -05:00
Miss Islington (bot) 0f40482fde
Fix host in address of socket.create_server example. (GH-17706)
Host as None in address raises TypeError since it should be string, bytes or bytearray.
(cherry picked from commit 43682f1e39)

Co-authored-by: Karthikeyan Singaravelan <tir.karthi@gmail.com>
2020-01-10 21:39:01 -08:00
Miss Islington (bot) df2fb60cf7
[3.8] Add test cases for dataclasses. (GH-17909) (GH-17919)
* Add test cases for dataclasses.

* Add test for repr output of field.
* Add test for ValueError to be raised when both default and default_factory are passed.
(cherry picked from commit eef1b027ab)


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

Automerge-Triggered-By: @ericvsmith
2020-01-10 04:12:08 -08:00
Miss Islington (bot) e47a7e3a7a Fix typo in test's docstring (GH-17856) (GH-17923)
* Fix typo in test's docstring. contination -> continuation.
(cherry picked from commit 2f65aa4658)

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

Co-authored-by: Daniel Hahler <github@thequod.de>
2020-01-09 23:03:05 +05:30
Miss Islington (bot) 8c08518c25
bpo-25172: Reduce scope of crypt import tests (GH-17881)
(cherry picked from commit ed367815ee)

Co-authored-by: Steve Dower <steve.dower@python.org>
2020-01-09 09:19:59 -08:00
Miss Islington (bot) b24e4fac03
bpo-39242: Updated the Gmane domain into news.gmane.io (GH-17903)
(cherry picked from commit 2e6a8efa83)

Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
2020-01-08 07:48:33 -08:00
Miss Islington (bot) 39a5c889d3
bpo-38871: Fix lib2to3 for filter-based statements that contain lambda (GH-17780)
Correctly parenthesize filter-based statements that contain lambda
expressions in lib2to3.
(cherry picked from commit b821173b54)

Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
2020-01-07 09:52:06 -08:00
Miss Islington (bot) bff48c6734 bpo-39198: Ensure logging global lock is released on exception in isEnabledFor (GH-17689) (GH-17897)
(cherry picked from commit 950c6795aa)
2020-01-07 17:03:23 +00:00
Andrew Svetlov 4112a3da2e
[3.8] bpo-39191: Fix RuntimeWarning in asyncio test (GH-17863) (#17894)
https://bugs.python.org/issue39191.
(cherry picked from commit 10ac0cded2)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
2020-01-07 16:55:19 +02:00
Miss Islington (bot) b2e281aaa2
bpo-39209: Manage correctly multi-line tokens in interactive mode (GH-17860)
(cherry picked from commit 5ec91f78d5)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2020-01-06 08:26:13 -08:00
Miss Islington (bot) 33cb4a62bf bpo-38907: Suppress any exception when attempting to set V6ONLY. (GH-17864) (GH-17865)
Fixes error attempting to bind to IPv4 address.
(cherry picked from commit 7cdc31a14c)

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
2020-01-06 08:28:27 -05:00
Miss Islington (bot) 5ed9d60bc5 bpo-38907: In http.server script, restore binding to IPv4 on Windows. (GH-17851) (#17854)
(cherry picked from commit ee94bdb059)

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
2020-01-06 07:34:10 -05:00
Miss Islington (bot) 5a065ac181
Minor formatting improvements and fixes to idle.rst (GH-17165)
(cherry picked from commit d6c08db853)

Co-authored-by: Tal Einat <taleinat+github@gmail.com>
2020-01-05 16:09:56 -08:00
Miss Islington (bot) 49c108c832
Fix constant folding optimization for positional only arguments (GH-17837)
(cherry picked from commit b121a4a45f)

Co-authored-by: Anthony Sottile <asottile@umich.edu>
2020-01-05 09:21:47 -08:00
Miss Islington (bot) 636a850ed8
bpo-39152: add missing ttk.Scale.configure return value (GH-17815)
tkinter.ttk.Scale().configure([name]) now returns a configuration tuple for name
or a list thereof for all options. Based on patch Giovanni Lombardo.
(cherry picked from commit 5ea7bb25e3)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2020-01-05 09:07:30 -08:00
Miss Islington (bot) 34aa3e71dc
bpo-39055: Reject a trailing \n in base64.b64decode() with validate=True. (GH-17616)
(cherry picked from commit b19c0d77e6)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2020-01-05 04:36:48 -08:00
Miss Islington (bot) e1caa49f68
bpo-39056: Fix handling invalid warning category in the -W option. (GH-17618)
No longer import the re module if it is not needed.
(cherry picked from commit 41ec17e45d)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2020-01-05 04:33:08 -08:00
Miss Islington (bot) fc84d501b9
bpo-39057: Fix urllib.request.proxy_bypass_environment(). (GH-17619)
Ignore leading dots and no longer ignore a trailing newline.
(cherry picked from commit 6a265f0d0c)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2020-01-05 04:32:00 -08:00
Miss Islington (bot) 859525590c
Fix SystemError when nested function has annotation on positional-only argument (GH-17826)
(cherry picked from commit ec007cb43f)

Co-authored-by: Anthony Sottile <asottile@umich.edu>
2020-01-04 18:14:58 -08:00
Andrew Svetlov 867d8333ce
[3.8] bpo-39191: Don't spawn a task before failing (GH-17796) (GH-17820)
(cherry picked from commit 3a5de51159)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
2020-01-04 11:49:11 +02:00
Miss Islington (bot) 1d5a7e5694 bpo-39142: Avoid converting namedtuple instances to ConvertingTuple. (GH-17773) (GH-17785)
(cherry picked from commit 46abfc1416)
2020-01-01 20:06:52 +00:00
Miss Islington (bot) 6c004955ac bpo-39176: Improve error message for 'named assignment' (GH-17777) (GH-17778)
(cherry picked from commit 37143a8e3b)

Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>

Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
2019-12-31 21:28:08 -06:00
Miss Islington (bot) 302b35f82b
Fix idlelib README typo. (GH-17770)
(cherry picked from commit ba82ee894c)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2019-12-31 10:52:38 -08:00
Dong-hee Na 2ee87913dd [3.8] bpo-38588: Fix possible crashes in dict and list when calling P… (GH-17764)
* [3.8] bpo-38588: Fix possible crashes in dict and list when calling PyObject_RichCompareBool (GH-17734)

Take strong references before calling PyObject_RichCompareBool to protect against the case
where the object dies during the call.
(cherry picked from commit 2d5bf568ea)

Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>

* Update Objects/listobject.c

@methane's suggestion

Co-Authored-By: Inada Naoki <songofacandy@gmail.com>

Co-authored-by: Inada Naoki <songofacandy@gmail.com>
2019-12-31 04:15:36 +00:00
Miss Islington (bot) fcaf14cd91
bpo-38610: Fix possible crashes in several list methods (GH-17022)
Hold strong references to list elements while calling PyObject_RichCompareBool().
(cherry picked from commit d9e561d23d)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2019-12-30 11:51:06 -08:00
Terry Jan Reedy df647f3340
[3.8] bpo-39136: Fixed typos (GH-17720)
funtion -> function; configuraton -> configuration; defintitions -> definitions;
focusses -> focuses; necesarily -> necessarily; follwing -> following;
Excape -> Escape,

(cherry picked from commit 6c7bb38ff2)
2019-12-28 19:05:15 -05:00
Miss Islington (bot) 4ed79b7800
Fix import path for asyncio.TimeoutError (GH-17691)
(cherry picked from commit 025eeaa196)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
2019-12-24 03:04:12 -08:00
Bar Harel 0846e5d460 [3.8] bpo-38878: Fix os.PathLike __subclasshook__ (GH-17336) (GH-17684)
https://bugs.python.org/issue38878
2019-12-23 18:31:00 +00:00
Łukasz Langa 114aad7b14 Python 3.8.1
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEE4/8oOcBIslwITevpsmmV4xAlBWgFAl36YEkACgkQsmmV4xAl
 BWh59Q/+OXxgPm7u3EG3KSDZk+Hcd7d7jcuODR67veRjIAe7PSvdPIttC39qVWv5
 j6mnH0xP3Q6wOcpOu+EpKiU60tvTYRVdk7BGCqZsFaQlIZY8lwbm30bw9x/wrFoa
 Qt7W1yJ00avn1x1rZ1ZejyOI9RL8im15WJF5NpS3eqX1EL+UBScrsQNjHGIYi+pM
 ERm+9BTTYVQ3odYnvQ6FsJIASf3IbWcQULtRsr7kGSP4E0Y9PXWCvy89tWay3R2N
 j1L11w7uL/RgqJUvfUljGwuWp2kiBEC1xIM85AzTo464IMIfix4aGhriLh4qX6ZD
 14sJmVJERdSqigpJlhwlaGIs2xOIzOcZ3Tok2aiJDGD9iqnsrtZFJRVGQxu4dExa
 UPfhskUxMdTEMD1vPAgU43JWZ5kMoz+eYP246UQELUCDqhW8ZP5f0Jx+MS8EcFf6
 qY1E/5RsxxSgOE5lcb25Cy63dvFVVtOHfLCt//P/jr8NP+hgpdVVJlqZNhKgoUGs
 KT75wck2MLss+OR0itCzdPsqUc27oMZJEhzeoq6+xNP8IysrTWl7AlmCPoinsaW0
 cKdlx47jnD9JYAjXXf8i7yjov2vaS7npWQYYujd01FGB9Ex7wSfAt54HmVfC1UuE
 Wl6t4s6PN0S9GJqHvbkrWkS6fjaKwHJAWH8Hi3Ik9omTGDgZxvY=
 =emOv
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQJEBAABCAAuFiEE4/8oOcBIslwITevpsmmV4xAlBWgFAl37LjYQHGx1a2FzekBs
 YW5nYS5wbAAKCRCyaZXjECUFaKcrD/sGsjOSMynwqBUWBIKOUpkxm8mhfsq4UeX+
 ThsvnruF+TY6vr/v3PO8+YS0TItdlN4xhKWfWeMrIJQwXug4ZFOCnK1yKd16iD5o
 yo259NhOiBX6v41I29L9PGYXdqQQDRd5MdI/8t9hx/XZVgBuYjXoesyRPvEbuPIJ
 8QlxVYx+lhxYeQ/1bEsl9CGX+PIYfWp+v/u2xsi9e5g8gMX0nbkv3wma2JDwDWhM
 nuG9yT8y1zZAGUHEKqKA4Gg2Iwrq2vHBZXfXLuFtTEl+EGUbOVjk0DBA/lu6prP5
 GrVDMrwEmOA9EN/ooXtpGno/mpX2vj6LmUPsfwgtAMDUB73UmkguohdjmpZrW/qf
 8U7oAXAw8ifkC09aHfIWKZHp8xZjhXO4v7hn8bMjTsurxQgCAJciBhrYv9nf2JHl
 ayA+SkScX9rRmAp0QuyjCq6QZyix2CG5ko6nnubg7WuvZbnXzgRum9MAOVa61Inn
 lYlkywmUQp4XhvuW3hOVyV83KZMKNmg0lsziy8bKGPd2cwMBxXTqiNLrDgUAvkBN
 7KlBoT6DWoRt4X1JWEFbCavqSoEjG1QHzfUN6QVcMnSzE9MGKFu5ICNKPgKxPmqf
 4qxP9oeWjUwpgrGL7iem91XPq79FrMeubiyIH/b88oR6qHhceIe7MJ73fyBNe5uN
 uj+5BUpujg==
 =pQD9
 -----END PGP SIGNATURE-----

Merge tag 'v3.8.1' into 3.8

Python 3.8.1
2019-12-19 09:00:46 +01:00
Victor Stinner b0eb046cbd
bpo-38546: Fix concurrent.futures test_ressources_gced_in_workers() (GH-17652) (GH-17655)
Fix test_ressources_gced_in_workers() of test_concurrent_futures:
explicitly stop the manager to prevent leaking a child process
running in the background after the test completes.

(cherry picked from commit 673c39331f)
2019-12-18 21:30:43 +01:00
Łukasz Langa 1b293b6006
Python 3.8.1 2019-12-18 18:21:23 +01:00
Victor Stinner 35acb35972
bpo-38546: multiprocessing tests stop the resource tracker (GH-17641) (GH-17647)
Multiprocessing and concurrent.futures tests now stop the resource
tracker process when tests complete.

Add ResourceTracker._stop() method to
multiprocessing.resource_tracker.

Add _cleanup_tests() helper function to multiprocessing.util: share
code between multiprocessing and concurrent.futures tests.

(cherry picked from commit 9707e8e22d)
2019-12-18 10:11:05 +01:00
Pablo Galindo b1f2044710 [3.8] bpo-39080: Starred Expression's column offset fix when inside a CALL (GH-17645) (GH-17649)
… 
Co-Authored-By: Pablo Galindo <Pablogsal@gmail.com>
(cherry picked from commit 50d4f12958)

Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>





https://bugs.python.org/issue39080
2019-12-17 17:41:58 -08:00
Ned Deily bf3aa1060a
bpo-38295: prevent test_relative_path of test_py_compile failure on macOS Catalina (GH-17636) 2019-12-17 04:05:41 -05:00
Miss Islington (bot) d21ad67d5e Fix warnings in test_asyncio.test_base_events (GH-17577) (GH-17579)
Co-authored-by: tirkarthi
(cherry picked from commit 1988344a6b)

Co-authored-by: Kyle Stanley <aeros167@gmail.com>
2019-12-16 23:11:11 -05:00
Miss Islington (bot) 8d0f36940e
bpo-38811: Check for presence of os.link method in pathlib (GH-17225)
Commit 6b5b013bcc ("bpo-26978: Implement pathlib.Path.link_to (Using
os.link) (GH-12990)") introduced a new link_to method in pathlib. However,
this makes pathlib crash when the 'os' module is missing a 'link' method.

Fix this by checking for the presence of the 'link' method on pathlib
module import, and if it's not present, turn it into a runtime error like
those emitted when there is no lchmod() or symlink().

Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
(cherry picked from commit 092435e932)

Co-authored-by: Toke Høiland-Jørgensen <toke@redhat.com>
2019-12-16 04:42:20 -08:00
Miss Islington (bot) ce333cd7d5 Fix elif start column offset when there is an else following (GH-17596) (GH-17600)
(cherry picked from commit 5936a4ce91)

Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
2019-12-14 10:43:42 +00:00
Miss Islington (bot) aa74a53ad6 bpo-36406: Handle namespace packages in doctest (GH-12520) (GH-17591)
(cherry picked from commit 8289e27393)

Co-authored-by: Xtreak <tir.karthi@gmail.com>
2019-12-13 15:30:41 -08:00
Miss Islington (bot) 3b18b17efc bpo-39031: Include elif keyword when producing lineno/col-offset info for if_stmt (GH-17582) (GH-17589)
When parsing an "elif" node, lineno and col_offset of the node now point to the "elif" keyword and not to its condition, making it consistent with the "if" node.

https://bugs.python.org/issue39031

Automerge-Triggered-By: @pablogsal
(cherry picked from commit 025a602af7)

Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
2019-12-13 16:21:54 +00:00
Miss Islington (bot) b738237d67 bpo-39022, bpo-38594: Sync with importlib_metadata 1.3 (GH-17568) (GH-17569)
* bpo-39022, bpo-38594: Sync with importlib_metadata 1.3 including improved docs for custom finders and better serialization support in EntryPoints.

* 📜🤖 Added by blurb_it.

* Correct module reference
(cherry picked from commit b7a0109cd2)

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
2019-12-10 20:47:06 -05:00
Łukasz Langa 8129e5e356 Python 3.8.1rc1
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEE4/8oOcBIslwITevpsmmV4xAlBWgFAl3uiPsACgkQsmmV4xAl
 BWh1PQ//fJRLYxpcIwreGvP1XXPACjyByXdYgwf5xuXeoPIjdNccMC30nDzbmitR
 zaqKXcQUOmjsFGEq95hctl7tUKzk2lgGQBf1gUOBIXcoGaK3UY30K6JgsvGKSQqd
 hyOCxSlrEjLU8pJpsTWtOH8o+sOtjlChopj88mLq9xNxaEBY+U6SIv9YN0FQhWDm
 RvvhBuQax4f+Bry3edH6eNqk9a4EsRQ9ud2ABwXPI71s1BUvNfdTwcU1NSI2JQaQ
 vJNT8yQXgP0hWJJfB4wFn9ior6q288WUhWATVTtF7dBGkuTI7e0PiaYezMUF+hTm
 bCsSbaFoNoCn5acYZtilGG+LRzMSp2svYJXMvTeaB5h8lpIexn0rIzMHqFAwhyGJ
 LMgXw32LXI9XaYbdqyON/pXUH24tL8fu5rgvupgnmtXnWSSxml2nVUv8zEqHTqmV
 TvOOf0jyVpSMvMab3sdc4OwV+VSyKVKtsAoEKt0K1Tq05hzUBvG41uxE+2rvxBYF
 dANyJK+0Jeo6ouTlQCIqefXBPUI7JXM+94BwOmLIEvhA/ycKFv2lOMibX1FZQO//
 TjOEK8NwGULY2Z1AdeC8TcDfT/iTefteljC6cq1FcAkHNwnMjWVrhvK0rqnrXUn2
 CpzoQm7GShP/ViUqgdAfM1czGM5mrlY8OWX7sFLSUN2mPOBLrgs=
 =f79H
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQJEBAABCAAuFiEE4/8oOcBIslwITevpsmmV4xAlBWgFAl3vU3UQHGx1a2FzekBs
 YW5nYS5wbAAKCRCyaZXjECUFaEiAEACcl0GKXfYz0C6texEO6FFMNJPQtXWNwdt5
 U2d1UsXhp4xJKLz7NhgAvVldjEB0WT20F0ZzC9Z9YIbOCgJLwbLm0nIINlQ7jxzM
 edz81gYYnnWNet4G57ljRdveMZ14K5CY9wijyPw89y7UHXZ93B9scMyccdRmFRuv
 A817Qr4Sdqy7JsbZ7PP9OKkroMeAVVf0Xj3v07ZIqq83+g3pDsnMZTEsRKhJXVnG
 rzllNQNYHFCz7ViBiBfK1AdYVRhkhjWaqvGadlaG//9qo7UymTrmVrNrllXy705o
 Z2fQS4c6IDkEC2+uFOYJdgdptsueKfZzzj5QITZz6NaIxE5PMFW2x4vLgEYPIj7w
 bPII8IkwRp+95iG60xxet0IQyIEh/HYwYa3Z4AeWH8ZYWSxkysgLx6qJ5KaYGBYC
 AAi5YCKo4gzvRABbd5uq5ebYutuXQWVJcDqtOl8f/SH8zvA2bVsv8H95SD7kwAGS
 EOuDN37unmTKjWNycFa0NLqTJqv7XUpMnKlwU2z2PPJHsqCRS9AkKqw7UU/ljbn6
 bc6lvOLTWI1CdqbGedbqGoi9oF4HAqSmmIgVjh16+fOYgYa1qRe/hcBn3Up+KVas
 5fVt/f4sR6C3sDKnh5ynVnLkzWZgJD4QBx4DS0ZYHnNCCVQfJQbdWpG+N4muiJAi
 oHIFP43J8w==
 =uwbV
 -----END PGP SIGNATURE-----

Merge tag 'v3.8.1rc1' into 3.8

Python 3.8.1rc1
2019-12-10 09:12:15 +01:00
Miss Islington (bot) 859767d58e bpo-39002: Fix simple typo: tranlation -> translation (GH-17517) (GH-17538)
(cherry picked from commit c18b805ac6)

Co-authored-by: Tim Gates <tim.gates@iress.com>
2019-12-09 17:35:25 -08:00
Miss Islington (bot) 34d5d5e096
bpo-38943: Fix IDLE autocomplete window not always appearing (GH-17416)
This has happened on some versions of Ubuntu.
(cherry picked from commit bbc4162baf)

Co-authored-by: JohnnyNajera <58344607+JohnnyNajera@users.noreply.github.com>
2019-12-09 16:48:20 -08:00
Miss Islington (bot) 2b2c7bf231
bpo-38944: Escape key now closes IDLE completion windows. (GH-17419)
(cherry picked from commit 232689b40d)

Co-authored-by: JohnnyNajera <58344607+JohnnyNajera@users.noreply.github.com>
2019-12-09 15:38:33 -08:00
Miss Islington (bot) 0ac9aaeb97
bpo-39007: Add auditing events to functions in winreg (GH-17541)
Also allows winreg.CloseKey() to accept same types as other functions.
(cherry picked from commit ee17e37356)

Co-authored-by: Steve Dower <steve.dower@python.org>
2019-12-09 11:36:25 -08:00
Łukasz Langa b00a2b5b76
Python 3.8.1rc1 2019-12-09 18:47:55 +01:00
Miss Islington (bot) 3c5feaffde bpo-38992: avoid fsum test failure from constant-folding (GH-17513) (GH-17530)
* Issue 38992: avoid fsum test failure

* Add NEWS entry
(cherry picked from commit bba873e633)

Co-authored-by: Mark Dickinson <mdickinson@enthought.com>
2019-12-09 11:32:34 -06:00
Miss Islington (bot) 0d57db27f2 bpo-34776: Fix dataclasses to support __future__ "annotations" mode (GH-9518) (#17531)
(cherry picked from commit d219cc4180)

Co-authored-by: Yury Selivanov <yury@magic.io>
2019-12-09 17:07:51 +01:00
Miss Islington (bot) 79c29742a8 bpo-37228: Fix loop.create_datagram_endpoint()'s usage of SO_REUSEADDR (GH-17311) (#17529)
(cherry picked from commit ab513a38c9)

Co-authored-by: Kyle Stanley <aeros167@gmail.com>
2019-12-09 15:39:54 +01:00
Miss Islington (bot) b22183f273
bpo-39006: Fix asyncio when the ssl module is missing (GH-17524)
Fix asyncio when the ssl module is missing: only check for
ssl.SSLSocket instance if the ssl module is available.
(cherry picked from commit 82b4950b5e)

Co-authored-by: Victor Stinner <vstinner@python.org>
2019-12-09 06:19:48 -08:00
Miss Islington (bot) d08fd298dc
bpo-38547: Fix test_pty if the process is the session leader (GH-17519)
Fix test_pty: if the process is the session leader, closing the
master file descriptor raises a SIGHUP signal: simply ignore SIGHUP
when running the tests.
(cherry picked from commit a1838ec259)

Co-authored-by: Victor Stinner <vstinner@python.org>
2019-12-09 03:15:23 -08:00
Miss Islington (bot) 4594565b56 bpo-38669: patch.object now raises a helpful error (GH17510)
This means a clearer message is now shown when patch.object is called with two string arguments, rather than a class and a string argument.
(cherry picked from commit cd90a52983)

Co-authored-by: Elena Oat <oat.elena@gmail.com>
2019-12-09 06:59:04 +00:00
Miss Islington (bot) 2abd3a8f58
bpo-38708: email: Fix a potential IndexError when parsing Message-ID (GH-17504)
Fix a potential IndexError when passing an empty value to the message-id
parser. Instead, HeaderParseError should be raised.
(cherry picked from commit 3ae4ea1931)

Co-authored-by: Abhilash Raj <maxking@users.noreply.github.com>
2019-12-08 18:12:50 -08:00
Miss Islington (bot) f66f4a09d0
bpo-38698: Add a new InvalidMessageID token to email header parser. (GH-17503)
This adds a new InvalidMessageID token to the email header parser which can be
used to represent invalid message-id headers in the parse tree.
(cherry picked from commit 68157da8b4)

Co-authored-by: Abhilash Raj <maxking@users.noreply.github.com>
2019-12-08 18:11:31 -08:00
Miss Islington (bot) 960fca1a58
bpo-38979: fix ContextVar "__class_getitem__" method (GH-17497)
now contextvars.ContextVar "__class_getitem__" method returns ContextVar class, not None.

https://bugs.python.org/issue38979

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

Co-authored-by: AMIR <31338382+amiremohamadi@users.noreply.github.com>
2019-12-08 04:49:07 -08:00
Miss Islington (bot) 9d3cacd590
[3.8] bpo-38820: OpenSSL 3.0.0 compatibility. (GH-17190) (GH-17499)
test_openssl_version now accepts version 3.0.0.

getpeercert() no longer returns IPv6 addresses with a trailing new line.

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


https://bugs.python.org/issue38820
(cherry picked from commit 2b7de6696b)


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


https://bugs.python.org/issue38820



Automerge-Triggered-By: @tiran
2019-12-07 09:20:27 -08:00
Andrew Svetlov 930cef2770
[3.8] bpo-37404: Raising value error if an SSLSocket is passed to asyncio functions (GH-16457) (#17496)
https://bugs.python.org/issue37404
(cherry picked from commit 892f9e0777)

Co-authored-by: idomic <michael.ido@gmail.com>
2019-12-07 14:44:20 +02:00
Miss Islington (bot) 7fde4f446a
bpo-38529: Fix asyncio stream warning (GH-17474)
(cherry picked from commit 7ddcd0caa4)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
2019-12-07 03:39:57 -08:00
Miss Islington (bot) 681285d052
bpo-36820: Break unnecessary cycle in socket.py, codeop.py and dyld.py (GH-13135)
Break cycle generated when saving an exception in socket.py, codeop.py and dyld.py as they keep alive not only the exception but user objects through the ``__traceback__`` attribute.

https://bugs.python.org/issue36820

Automerge-Triggered-By: @pablogsal
(cherry picked from commit b64334cb93)

Co-authored-by: Mario Corchero <mcorcherojim@bloomberg.net>
2019-12-06 06:59:49 -08:00
Miss Islington (bot) e21aa61e96
bpo-38698: Prevent UnboundLocalError to pop up in parse_message_id (GH-17277)
parse_message_id() was improperly using a token defined inside an exception
handler, which was raising `UnboundLocalError` on parsing an invalid value.

https://bugs.python.org/issue38698
(cherry picked from commit bb815499af)

Co-authored-by: Claudiu Popa <pcmanticore@gmail.com>
2019-12-05 09:42:01 -08:00
Miss Islington (bot) cfdaf92221
[3.8] bpo-38270: Fix indentation of test_hmac assertions (GH-17446) (GH-17450)
Since c64a1a61e6 two assertions were indented and thus ignored when running test_hmac.

This PR fixes it. As the change is quite trivial I didn't add a NEWS entry.


https://bugs.python.org/issue38270
(cherry picked from commit 894331838b)


Co-authored-by: stratakis <cstratak@redhat.com>


https://bugs.python.org/issue38270



Automerge-Triggered-By: @tiran
2019-12-05 08:51:30 -08:00
Miss Islington (bot) a75cad440a
bpo-33684: json.tool: Use utf-8 for infile and outfile. (GH-17460)
(cherry picked from commit 808769f3a4)

Co-authored-by: Inada Naoki <songofacandy@gmail.com>
2019-12-04 01:57:55 -08:00
Miss Islington (bot) 8859fc6294
bpo-38945: UU Encoding: Don't let newline in filename corrupt the output format (GH-17418)
(cherry picked from commit a62ad4730c)

Co-authored-by: Matthew Rollings <1211162+stealthcopter@users.noreply.github.com>
2019-12-02 14:44:44 -08:00
Miss Islington (bot) 9e728806d0
bpo-38815: Accept TLSv3 default in min max test (GH-NNNN) (GH-17437)
Make ssl tests less strict and also accept TLSv3 as the default maximum
version. This change unbreaks test_min_max_version on Fedora 32.

https://bugs.python.org/issue38815
(cherry picked from commit 34864d1cff)

Co-authored-by: torsava <torsava@redhat.com>
2019-12-02 08:34:44 -08:00
Miss Islington (bot) 4f1eaf0280
bpo-38449: Add URL delimiters test cases (GH-16729)
* bpo-38449: Add tricky test cases

* bpo-38449: Reflect codereview
(cherry picked from commit 2fe4c48917)

Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
2019-12-01 15:24:17 -08:00
Steve Dower b74a6f14b9
bpo-38920: Add audit hooks for when sys.excepthook and sys.unraisablehook are invoked (GH-17392)
Also fixes some potential segfaults in unraisable hook handling.
2019-11-28 08:46:23 -08:00
Miss Islington (bot) d21b8e82dd
bpo-26730: Fix SpooledTemporaryFile data corruption (GH-17400)
SpooledTemporaryFile.rollback() might cause data corruption
when it is in text mode.

Co-Authored-By: Serhiy Storchaka <storchaka@gmail.com>
(cherry picked from commit ea9835c5d1)

Co-authored-by: Inada Naoki <songofacandy@gmail.com>
2019-11-27 21:23:14 -08:00
Bruno P. Kinoshita 65c92c5870 [3.8] bpo-38688, shutil.copytree: consume iterator and create list of entries to prevent infinite recursion (GH-17397)
(cherry picked from commit 9bbcbc9f6d)

Co-authored-by: Bruno P. Kinoshita <kinow@users.noreply.github.com>
2019-11-27 12:49:37 +08:00
Terry Jan Reedy a9c86f5e1a
[3.8] bpo-38862: IDLE Strip Trailing Whitespace fixes end newlines (GH-17366)
Extra newlines are removed at the end of non-shell files. If the file only has newlines after stripping other trailing whitespace, all are removed, as is done by patchcheck.py.
(cherry picked from commit 6bf644ec82)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2019-11-26 20:13:23 -05:00
Miss Islington (bot) b9e5547f58
bpo-38686: fix HTTP Digest handling in request.py (GH-17045)
* fix HTTP Digest handling in request.py

There is a bug triggered when server replies to a request with `WWW-Authenticate: Digest` where `qop="auth,auth-int"` rather than mere `qop="auth"`. Having both `auth` and `auth-int` is legitimate according to the `qop-options` rule in §3.2.1 of [[https://www.ietf.org/rfc/rfc2617.txt|RFC 2617]]:
>      qop-options       = "qop" "=" <"> 1GH-qop-value <">
>      qop-value         = "auth" | "auth-int" | token
> **qop-options**: [...] If present, it is a quoted string **of one or more** tokens indicating the "quality of protection" values supported by the server.  The value `"auth"` indicates authentication; the value `"auth-int"` indicates authentication with integrity protection

This is description confirmed by the definition of the [//n//]`GH-`[//m//]//rule// extended-BNF pattern defined in §2.1 of [[https://www.ietf.org/rfc/rfc2616.txt|RFC 2616]] as 'a comma-separated list of //rule// with at least //n// and at most //m// items'.

When this reply is parsed by `get_authorization`, request.py only tests for identity with `'auth'`, failing to recognize it as one of the supported modes the server announced, and claims that `"qop 'auth,auth-int' is not supported"`.

* 📜🤖 Added by blurb_it.

* bpo-38686 review fix: remember why.

* fix trailing space in Lib/urllib/request.py

Co-Authored-By: Brandt Bucher <brandtbucher@gmail.com>
(cherry picked from commit 14a89c4798)

Co-authored-by: PypeBros <PypeBros@users.noreply.github.com>
2019-11-22 15:36:38 -08:00
Miss Islington (bot) a1e1be4c49
bpo-38804: Fix REDoS in http.cookiejar (GH-17157)
The regex http.cookiejar.LOOSE_HTTP_DATE_RE was vulnerable to regular
expression denial of service (REDoS).

LOOSE_HTTP_DATE_RE.match is called when using http.cookiejar.CookieJar
to parse Set-Cookie headers returned by a server.
Processing a response from a malicious HTTP server can lead to extreme
CPU usage and execution will be blocked for a long time.

The regex contained multiple overlapping \s* capture groups.
Ignoring the ?-optional capture groups the regex could be simplified to

    \d+-\w+-\d+(\s*\s*\s*)$

Therefore, a long sequence of spaces can trigger bad performance.

Matching a malicious string such as

    LOOSE_HTTP_DATE_RE.match("1-c-1" + (" " * 2000) + "!")

caused catastrophic backtracking.

The fix removes ambiguity about which \s* should match a particular
space.

You can create a malicious server which responds with Set-Cookie headers
to attack all python programs which access it e.g.

    from http.server import BaseHTTPRequestHandler, HTTPServer

    def make_set_cookie_value(n_spaces):
        spaces = " " * n_spaces
        expiry = f"1-c-1{spaces}!"
        return f"b;Expires={expiry}"

    class Handler(BaseHTTPRequestHandler):
        def do_GET(self):
            self.log_request(204)
            self.send_response_only(204)  GH- Don't bother sending Server and Date
            n_spaces = (
                int(self.path[1:])  GH- Can GET e.g. /100 to test shorter sequences
                if len(self.path) > 1 else
                65506  GH- Max header line length 65536
            )
            value = make_set_cookie_value(n_spaces)
            for i in range(99):  GH- Not necessary, but we can have up to 100 header lines
                self.send_header("Set-Cookie", value)
            self.end_headers()

    if __name__ == "__main__":
        HTTPServer(("", 44020), Handler).serve_forever()

This server returns 99 Set-Cookie headers. Each has 65506 spaces.
Extracting the cookies will pretty much never complete.

Vulnerable client using the example at the bottom of
https://docs.python.org/3/library/http.cookiejar.html :

    import http.cookiejar, urllib.request
    cj = http.cookiejar.CookieJar()
    opener = urllib.request.build_opener(urllib.request.HTTPCookieProcessor(cj))
    r = opener.open("http://localhost:44020/")

The popular requests library was also vulnerable without any additional
options (as it uses http.cookiejar by default):

    import requests
    requests.get("http://localhost:44020/")

* Regression test for http.cookiejar REDoS

If we regress, this test will take a very long time.

* Improve performance of http.cookiejar.ISO_DATE_RE

A string like

"444444" + (" " * 2000) + "A"

could cause poor performance due to the 2 overlapping \s* groups,
although this is not as serious as the REDoS in LOOSE_HTTP_DATE_RE was.
(cherry picked from commit 1b779bfb85)

Co-authored-by: bcaller <bcaller@users.noreply.github.com>
2019-11-22 06:42:06 -08:00
Miss Islington (bot) c3cd0de9ec bpo-22367: Update test_fcntl.py for spawn process mode (GH-17154) (GH-17252)
(cherry picked from commit 9960230f76)

Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
2019-11-22 15:15:36 +01:00
Lisa Roach b2744c1be7 [3.8] bpo-38857: AsyncMock fix for awaitable values and StopIteration fix [3.8] (GH-17269) (#17304)
(cherry picked from commit 046442d02b)

Co-authored-by: Jason Fried <fried@fb.com>
2019-11-21 20:14:32 +02:00
Miss Islington (bot) 9458c5c42b
bpo-37838: get_type_hints for wrapped functions with forward reference (GH-17126)
https://bugs.python.org/issue37838
(cherry picked from commit 0aca3a3a1e)

Co-authored-by: benedwards14 <53377856+benedwards14@users.noreply.github.com>
2019-11-21 09:43:42 -08:00
Miss Islington (bot) 767b42633b
bpo-38875: test_capi: trashcan tests require cpu resource (GH-17314)
test_capi: trashcan tests now require the test "cpu" resource.
(cherry picked from commit 0127bb1c5c)

Co-authored-by: Victor Stinner <vstinner@python.org>
2019-11-21 04:11:44 -08:00
Miss Islington (bot) b762375ba2
bpo-38841: Skip asyncio test_create_datagram_endpoint_existing_sock_unix (GH-17294)
on platforms lacking a functional bind() for named unix domain sockets

https://bugs.python.org/issue38841

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

Co-authored-by: xdegaye <xdegaye@gmail.com>
2019-11-20 12:20:25 -08:00
Miss Islington (bot) 836f137f7a
bpo-38821: Fix crash in argparse when using gettext (GH-17192)
(cherry picked from commit be5c79e033)

Co-authored-by: Federico Bond <federicobond@gmail.com>
2019-11-20 05:48:25 -08:00
Miss Islington (bot) 132243957c
bpo-38636: Fix IDLE tab toggle and file indent width (GH-17008)
These Format menu functions (default shortcuts Alt-T and Alt-U)
were mistakenly disabled in 3.7.5 and 3.8.0.
(cherry picked from commit b8462477bf)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2019-11-19 22:37:47 -08:00
Miss Islington (bot) 829593a926
bpo-38707: Fix for multiprocessing.Process MainThread.native_id (GH-17088)
This PR implements a fix for `multiprocessing.Process` objects; the error occurs when Processes are created using either `fork` or `forkserver` as the `start_method`.

In these instances, the `MainThread` of the newly created `Process` object retains all attributes from its parent's `MainThread` object, including the `native_id` attribute. The resulting behavior is such that the new process' `MainThread` captures an incorrect/outdated `native_id` (the parent's instead of its own).

This change forces the Process object to update its `native_id` attribute during the bootstrap process.

cc @vstinner

https://bugs.python.org/issue38707

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

Co-authored-by: Jake Tesler <jake.tesler@gmail.com>
2019-11-19 12:11:20 -08:00
Miss Islington (bot) 6c3b471c8c
bpo-35409: Ignore GeneratorExit in async_gen_athrow_throw (GH-14755)
Ignore `GeneratorExit` exceptions when throwing an exception into the `aclose` coroutine of an asynchronous generator.

https://bugs.python.org/issue35409
(cherry picked from commit 8e0de2a480)

Co-authored-by: Vincent Michel <vxgmichel@gmail.com>
2019-11-19 06:12:06 -08:00
Miss Islington (bot) b5bb3b637c bpo-38807: Add os.PathLike to exception message raised by _check_arg_types (GH-17160) (GH-17249)
(cherry picked from commit fe75b62575)

Co-authored-by: Tomás Farías <tomasfariassantana@gmail.com>
2019-11-18 22:46:10 -08:00
Miss Islington (bot) e37767bee1
bpo-38722: Runpy use io.open_code() (GH-17234)
https://bugs.python.org/issue38722

Automerge-Triggered-By: @taleinat
(cherry picked from commit e243bae999)

Co-authored-by: jsnklln <jsnklln@gmail.com>
2019-11-18 13:58:02 -08:00
Miss Islington (bot) 47db7439dd
bpo-38622: Add missing audit events for ctypes module (GH-17158)
(cherry picked from commit 00923c6399)

Co-authored-by: Steve Dower <steve.dower@python.org>
2019-11-18 11:53:34 -08:00
Miss Islington (bot) bef2815533 bpo-16576: Add checks for bitfields passed by value to functions. (GH-17097) (GH-17223)
(cherry picked from commit 106271568c)
2019-11-18 14:29:15 +00:00
Miss Islington (bot) e7c495e32c
Fix typo in Lib/socketserver.py (GH-17024)
changed 'This is bad class design, but save some typing'
into 'This is bad class design, but saves some typing'.
(cherry picked from commit d0acdfcf34)

Co-authored-by: Jason (Perry) Taylor <jtaylor@seek.com.au>
2019-11-16 10:35:08 -08:00
Miss Islington (bot) 6f602fbd35
bpo-38453: Ensure correct short path is obtained for test (GH-17184)
(cherry picked from commit 7c6130c8c3)

Co-authored-by: Steve Dower <steve.dower@python.org>
2019-11-15 16:21:27 -08:00
Steve Dower 66c0f01f98
bpo-38453: Ensure ntpath.realpath correctly resolves relative paths (GH-16967)
Ensure isabs() is always True for \\?\ prefixed paths
Avoid unnecessary usage of readlink() to avoid resolving broken links incorrectly
Ensure shutil tests run in test directory
2019-11-15 15:25:03 -08:00
Miss Islington (bot) 694c03fabb
bpo-38785: Prevent asyncio from crashing (GH-17144)
if parent `__init__` is not called from a constructor of object derived from `asyncio.Future`

https://bugs.python.org/issue38785
(cherry picked from commit dad6be5ffe)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
2019-11-13 13:54:56 -08:00
Miss Islington (bot) a67bc10e42
bpo-4630: Add cursor no-blink option for IDLE (GH-16960)
This immediately toggles shell, editor, and output windows, but does not affect other input widgets.
(cherry picked from commit 9c2844927d)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2019-11-12 23:36:42 -08:00
Benjamin Peterson 9788f97bf6
[3.8] closes bpo-27805: Ignore ESPIPE in initializing seek of append-mode files. (GH-17136)
This change, which follows the behavior of C stdio's fdopen and Python 2's file object, allows pipes to be opened in append mode..
(cherry picked from commit 74fa9f723f)
2019-11-12 15:54:19 -08:00
Miss Islington (bot) 0a8e7fde06
bpo-38723: Pdb._runscript should use io.open_code() instead of open() (GH-17127)
Co-Authored-By: Brandt Bucher <brandtbucher@gmail.com>
(cherry picked from commit d593881505)

Co-authored-by: jsnklln <jsnklln@gmail.com>
2019-11-12 15:09:03 -08:00
Serhiy Storchaka d360346640
[3.8] bpo-38738: Fix formatting of True and False. (GH-17083) (GH-17125)
* "Return true/false" is replaced with "Return ``True``/``False``"
  if the function actually returns a bool.
* Fixed formatting of some True and False literals (now in monospace).
* Replaced "True/False" with "true/false" if it can be not only bool.
* Replaced some 1/0 with True/False if it corresponds the code.
* "Returns <bool>" is replaced with "Return <bool>".
(cherry picked from commit 138ccbb022)
2019-11-12 18:54:10 +02:00
Miss Islington (bot) 8ce1a9ce03
bpo-26353: IDLE adds an unneeded newline when saving a shell window (GH-17103)
(cherry picked from commit c8b53dc3d8)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2019-11-12 03:13:18 -08:00
Terry Jan Reedy 8341a4d918
[3.8] bpo-37309: idlelib/NEWS.txt - add missing period. (#17115) 2019-11-12 05:02:48 -05:00
Miss Islington (bot) 3562439eb2 bpo-38385: Fix iterator/iterable terminology in statistics docs (GH-17111) (GH-17113)
(cherry picked from commit 733b9a308e)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
2019-11-12 00:04:12 -08:00
Miss Islington (bot) 85e4151082
bpo-22367: Add tests for fcntl.lockf(). (GH-17010)
(cherry picked from commit befa032d88)

Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
2019-11-09 03:12:28 -08:00
Miss Islington (bot) e8bad63034
Fix a typo in wave module docstring (GH-17009)
s/pathing/patching/
(cherry picked from commit 25fa3ecb98)

Co-authored-by: Michael Haas <micha2718l@gmail.com>
2019-11-04 21:09:48 -08:00
Miss Skeleton (bot) aa1fee8ffb
bpo-38422: Clarify docstrings of pathlib suffix(es) (GH-16679)
Whenever I use `path.suffix` I have to check again whether it includes the dot or not. I decided to add it to the docstring so I won't have to keep checking.

https://bugs.python.org/issue38422

Automerge-Triggered-By: @pitrou
(cherry picked from commit 8d4fef4ee2)

Co-authored-by: Ram Rachum <ram@rachum.com>
2019-11-02 10:04:10 -07:00
Jon Janzen fe934e1d03 [3.8] Slightly improve plistlib test coverage. (GH-17025) (GH-17028)
* Add missing test class (mistake in GH-4455)

* Increase coverage with 4 more test cases

* Rename neg_uid to huge_uid in test_modified_uid_huge

* Replace test_main() with unittest.main()

* Update plistlib docs.
(cherry picked from commit d0d9f7cfa3)

Co-authored-by: Jon Janzen <jjjonjanzen@gmail.com>
2019-11-02 16:48:22 +02:00
Vinay Sajip 9528997048
[3.8] bpo-16575: Add checks for unions passed by value to functions. (GH-16799) (GH-17016)
(cherry picked from commit 79d4ed102a)
2019-10-31 13:34:05 +00:00
Miss Skeleton (bot) c1ebe6a125 Add docstring for shlex.split (GH-16740) (GH-17013)
(cherry picked from commit 65c7382c47)

Co-authored-by: MaT1g3R <peijun.ma@protonmail.com>
2019-10-31 12:50:04 +00:00
Miss Skeleton (bot) dcb338ea1b
bpo-38640: Allow break and continue in always false while loops (GH-16992)
(cherry picked from commit 6c3e66a34b)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2019-10-30 05:11:41 -07:00
Miss Skeleton (bot) 3801b2699e
bpo-36993: Improve error reporting for zipfiles with bad zip64 extra data. (GH-14656)
(cherry picked from commit da6ce58dd5)

Co-authored-by: Daniel Hillier <daniel.hillier@gmail.com>
2019-10-29 00:44:07 -07:00
Miss Skeleton (bot) 76fbdaa2a6
bpo-38334: Fix seeking backward on an encrypted zipfile.ZipExtFile. (GH-16937)
Test by Daniel Hillier.
(cherry picked from commit 5c32af7522)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2019-10-27 01:40:44 -07:00
Terry Jan Reedy 6d6418a075
[3.8] bpo-37309: First idlelib/NEWS.txt for 3.8.1 (GH-16947) 2019-10-27 01:25:27 -04:00
Miss Skeleton (bot) 7a3b1a6f0b
bpo-34162: Last idlelib/NEWS.txt items for 3.8.0. (GH-16943)
(cherry picked from commit e31a79a5b4)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2019-10-26 19:37:25 -07:00
Miss Skeleton (bot) e3a477aa07
bpo-38598: Do not try to compile IDLE shell or output windows (GH-16939)
(cherry picked from commit e3f90b217a)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2019-10-26 18:41:26 -07:00
Miss Skeleton (bot) ba3a566328
bpo-38535: Fix positions for AST nodes for calls without arguments in decorators. (GH-16861)
(cherry picked from commit 26ae9f6d3d)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2019-10-26 07:06:40 -07:00
Miss Skeleton (bot) d04661f9ca
bpo-33348: parse expressions after * and ** in lib2to3 (GH-6586)
These are valid even in python 2.7

https://bugs.python.org/issue33348

Automerge-Triggered-By: @gpshead
(cherry picked from commit 96b06aefe2)

Co-authored-by: Zsolt Dollenstein <zsol.zsol@gmail.com>
2019-10-23 23:37:21 -07:00
Miss Skeleton (bot) cbf474c98e
bpo-34679: ProactorEventLoop only uses set_wakeup_fd() in main thread (GH-16901)
bpo-34679, bpo-38563: asyncio.ProactorEventLoop.close() now only calls
signal.set_wakeup_fd() in the main thread.
(cherry picked from commit 1b53a24fb4)

Co-authored-by: Victor Stinner <vstinner@python.org>
2019-10-23 08:43:57 -07:00
Miss Skeleton (bot) 2f8d4f08e2
bpo-31202: Preserve case of literal parts in Path.glob() on Windows. (GH-16860)
(cherry picked from commit 10ecbadb79)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2019-10-21 11:17:57 -07:00
Miss Islington (bot) d73205d788
bpo-38525: Fix a segmentation fault when using reverse iterators of empty dict (GH-16846)
The reverse iterator for empty dictionaries was not handling correctly shared-key dictionaries.
(cherry picked from commit 24dc2f8c56)

Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
2019-10-19 13:20:51 -07:00
Miss Islington (bot) 652a1cb0e1 bpo-38521: Fix error in NormalDist.__eq__() (GH-16840) (GH-16842)
(cherry picked from commit 5eabec022b)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
2019-10-18 14:41:19 -07:00
Senthil Kumaran 0f3187c1ce
[3.8] bpo-27657: Fix urlparse() with numeric paths (GH-661) (#16839)
* bpo-27657: Fix urlparse() with numeric paths

Revert parsing decision from bpo-754016 in favor of the documented
consensus in bpo-16932 of how to treat strings without a // to
designate the netloc.

* bpo-22891: Remove urlsplit() optimization for 'http' prefixed inputs.
(cherry picked from commit 5a88d50ff0)

Co-authored-by: Tim Graham <timograham@gmail.com>
2019-10-18 08:23:14 -07:00
Miss Islington (bot) c615db608d
bpo-33604: Raise TypeError on missing hmac arg. (GH-16805)
Also updates the documentation to clarify the situation surrounding
the digestmod parameter that is required despite its position in the
argument list as of 3.8.0 as well as removing old python2 era
references to "binary strings".

We indavertently had this raise ValueError in 3.8.0 for the missing
arg.  This is not considered an API change as no reasonable code would
be catching this missing argument error in order to handle it.
(cherry picked from commit f33c57d5c7)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2019-10-17 20:48:42 -07:00
Miss Islington (bot) afbcd9f26d
bpo-35998: Fix test_asyncio.test_start_tls_server_1() (GH-16815)
main() is now responsible to send the ANSWER, rather than
ServerProto. main() now waits until it got the HELLO before sending
the ANSWER over the new transport.

Previously, there was a race condition between main() replacing the
protocol and the protocol sending the ANSWER once it gets the HELLO.

TLSv1.3 was disabled for the test: reenable it.
(cherry picked from commit fab4ef2df0)

Co-authored-by: Victor Stinner <vstinner@python.org>
2019-10-16 01:36:57 -07:00
Miss Islington (bot) f705f8e9b5
bpo-38478: Correctly handle keyword argument with same name as positional-only parameter (GH-16800)
(cherry picked from commit f3ef06a7cb)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2019-10-15 05:02:34 -07:00
Victor Stinner f82ce5b1b1
[3.8] bpo-36389: Backport debug enhancements from master (GH-16796)
* bpo-36389: _PyObject_CheckConsistency() available in release mode (GH-16612)

bpo-36389, bpo-38376: The _PyObject_CheckConsistency() function is
now also available in release mode. For example, it can be used to
debug a crash in the visit_decref() function of the GC.

Modify the following functions to also work in release mode:

* _PyDict_CheckConsistency()
* _PyObject_CheckConsistency()
* _PyType_CheckConsistency()
* _PyUnicode_CheckConsistency()

Other changes:

* _PyMem_IsPtrFreed(ptr) now also returns 1 if ptr is NULL
  (equals to 0).
* _PyBytesWriter_CheckConsistency() now returns 1 and is only used
  with assert().
* Reorder _PyObject_Dump() to write safe fields first, and only
  attempt to render repr() at the end.

(cherry picked from commit 6876257eaa)

* bpo-36389: Fix _PyBytesWriter in release mode (GH-16624)

Fix _PyBytesWriter API when Python is built in release mode with
assertions.

(cherry picked from commit 60ec6efd96)

* bpo-38070: Enhance visit_decref() debug trace (GH-16631)

subtract_refs() now pass the parent object to visit_decref() which
pass it to _PyObject_ASSERT(). So if the "is freed" assertion fails,
the parent is used in debug trace, rather than the freed object. The
parent object is more likely to contain useful information. Freed
objects cannot be inspected are are displayed as "<object at xxx is
freed>" with no other detail.

(cherry picked from commit 4d5f94b8cd)

* Fix also a typo in PYMEM_DEADBYTE macro comment

* bpo-36389: Add newline to _PyObject_AssertFailed() (GH-16629)

Add a newline between the verbose object dump and the Py_FatalError()
logs for readability.

(cherry picked from commit 7775349895)
2019-10-15 03:06:16 +02:00
Gregory P. Smith 4f0587f161
[3.8] bpo-38456: Use /bin/true in test_subprocess (GH-16737)
* [3.8] bpo-38456: Use /bin/true in test_subprocess (GH-16736)

Instead of sys.executable, "-c", "pass" or "import sys; sys.exit(0)"
use /bin/true when it is available.  On a reasonable machine this
shaves up to two seconds wall time off the otherwise ~40sec execution
on a --with-pydebug build.  It should be more notable on many
buildbots or overloaded slower I/O systems (CI, etc)..
(cherry picked from commit 67b93f80c7)

* Handle when there is no 'true' command

backport of 46113e0cf3 by Pablo Galindo.
2019-10-14 13:40:32 -07:00
Łukasz Langa 85da2ddc89 Python 3.8.0
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEE4/8oOcBIslwITevpsmmV4xAlBWgFAl2keYQACgkQsmmV4xAl
 BWgtYA/+OuuxCQieZTU9h10naQvzp42/4g69EjvV396wvgGWABxAUVQGJr5swX39
 M3Z8f26AhIhxyLP55BqHB+0RxnuEZ/9EtbPUhAu/LJFj6jct2YtFcObAect+Ey0l
 +rdPY5amCLgJGghG7sEaWD7MOn5SK/ub6jFbY9Jj7fBdaKe+jj703tw3iR0TfCtH
 m1vrBnD4iMt3+7N7FlOXV84UGfwQtYWOyNYn9mUCi+beFDmoScMItpkozKKK+1FC
 jEatdZIiWHOaacgSXcYRxDRPOt8W/YewW5wbnk+/i/7uiUcPJAKpoKr07tRImVDX
 D0Uc0IMJIyAKNw4jlo0yBoG1QdovqnFGCsJgnhmJKeQgWKiJMlFWF0jn7rnl/Awu
 xGp5xedIUVQ8wKuhIEkIalZ9LI/IKEmhwQTz7aPyV9okiFlHHonpxmgeQWFZgmzN
 4XD/+ihuZRJ+KUTshTqAYzbQ1uNjZJzOjJUwiV1LRXHaYxixW8yrFsr+jcpWGybF
 j2YTNKh7JSWloAa/bZdD+TPp8mATAXvGqoRa8YaDWzYogD8avpIsoSzNchKPEEO7
 HyapQykFlmR7roOOgqLt1BmJvnbLJeQYdNc/PadtNlyiI+IVaQiiEr9EYpe/Nnz7
 0krlnTZmcKekXoc7VopPhB9s2jLAoCVeIr/WE6CHbZ6NBeauIcQ=
 =u2+m
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQJEBAABCAAuFiEE4/8oOcBIslwITevpsmmV4xAlBWgFAl2k1EMQHGx1a2FzekBs
 YW5nYS5wbAAKCRCyaZXjECUFaMhNEACVjtdwLS3T+U04gyYbYbBEv5ETpplDvhI8
 sNgNWncp2pHav5RJqzxOMoCUrlh1axgylqceMFtxkTbYiQvbEtna+K6jYW94mz2t
 TJhS9hWaSN8lUp9W637t0evn8ah3unuyfS3aqBs9LxLV9UJcn2hzJqbLJ288JClm
 7ZrAkD2CqQse2vs+XN6no2V2Pc4XRf40v4XstJS5dqykg7cvbaSnpnyHKYJEV3bM
 MyUoXUR/D7rxXtwOPLqtDlFrZj690IuAjPuV3o0+0MXXs6JJ+flWo5HFQ/EUGdt1
 Yq30gt4iau/Jdy/mVJCBggD79BVz3lcTfITZQ9CwpgxeivxeCqamlYsTwylanLrU
 CNyCLeyhEB5m2VyZ/yWIqoTcN7hxKXYqAn6ELKHIy2O/JcT00giG9IDDC7+OeW3Q
 8jN7zhb1AXhO1u+S+Kraw6fJDUxnq3AEknfShUpOW2KfyQwxh2HjpHJGPSrzIkjZ
 YMC8t6tyvHlpFnoqHWknLURkm4l8zfxl7rg4Z2tnu/41MmHtZE0MocDLKytzXUW2
 zsxJllqA6rRJPh4Rz/n6Mb6o4vgdJ5tHT2rsxhSmu2YiRjD4hp3Ovm5T6TMdMquh
 r+BXlMl+lN5J6xuEvwNSlUMcU/QKOrAvPBlgsSwhXMVp2/HZ20kfc2gRWg6O4PhM
 eMzH9by1Uw==
 =W9XA
 -----END PGP SIGNATURE-----

Merge tag 'v3.8.0' into 3.8

Python 3.8.0
2019-10-14 22:02:08 +02:00
Miss Islington (bot) aa909b6b12
bpo-38453: Resolve test directories before chdir to them (GH-16723)
(cherry picked from commit d83fc27029)

Co-authored-by: Steve Dower <steve.dower@python.org>
2019-10-14 09:01:29 -07:00
Łukasz Langa fa919fdf25
v3.8.0 2019-10-14 15:34:47 +02:00
Miss Islington (bot) 927f07c816 bpo-38469: Handle named expression scope with global/nonlocal keywords (GH-16755) (#16760)
The symbol table handing of PEP572's assignment expressions is not resolving correctly the scope of some variables in presence of global/nonlocal keywords in conjunction with comprehensions.
(cherry picked from commit fd5c414880)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2019-10-14 13:40:15 +02:00
Miss Islington (bot) 6da52ac411
bpo-38431: Fix __repr__ method of InitVar to work with typing objects. (GH-16702)
(cherry picked from commit 793cb85437)

Co-authored-by: Samuel Colvin <samcolvin@gmail.com>
2019-10-13 05:04:05 -07:00
Miss Islington (bot) e540bb5461
bpo-38332: Catch KeyError from unknown cte in encoded-word. (GH-16503)
KeyError should cause a failure in parsing the encoded word and should be caught and raised as a _InvalidEWError instead.
(cherry picked from commit 65dcc8a8dc)

Co-authored-by: Andrei Troie <andreitroie90@gmail.com>
2019-10-12 10:03:24 -07:00
Abhilash Raj 5a638a8055
[3.8] bpo-38449: Revert "bpo-22347: Update mimetypes.guess_type to allow oper parsing of URLs" (GH-16724) (GH-16728)
This reverts commit 87bd2071c7.

The reason for revert is a regression caused by the change in 3.8.0rc1, see bpo-38449 for more details.

https://bugs.python.org/issue38449
(cherry picked from commit 19a3d87300)

Co-authored-by: Abhilash Raj <maxking@users.noreply.github.com>
2019-10-12 09:58:11 -07:00
Miss Islington (bot) 1da648aceb
bpo-38341: Add SMTPNotSupportedError in the exports of smtplib (GH-16525)
Add SMTPNotSupportedError in the exports of smtplib

Co-Authored-By: Brandt Bucher <brandtbucher@gmail.com>
(cherry picked from commit 3faf826e58)

Co-authored-by: nde <denayer.norman@gmail.com>
2019-10-12 09:08:24 -07:00
Miss Islington (bot) 73665b4147
bpo-38347: find pathfix for Python scripts whose name contain a '-' (GH-16536)
pathfix.py: Assume all files that end on '.py' are Python scripts when working recursively.
(cherry picked from commit 2b7dc40b2a)

Co-authored-by: Ruediger Pluem <r.pluem@gmx.de>
2019-10-11 06:56:49 -07:00
Miss Islington (bot) 398d84747d
Re-enable the OverflowError test for test_truediv on test_complex (GH-16591)
(cherry picked from commit 1dbe537385)

Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
2019-10-10 10:11:07 -07:00
Miss Islington (bot) 8ab11c433a bpo-38109: Add missing constants to Lib/stat.py (GH-16665) (GH-16690)
Add missing stat.S_IFDOOR, stat.S_IFPORT, stat.S_IFWHT,
stat.S_ISDOOR, stat.S_ISPORT, and stat.S_ISWHT values to
the Python implementation of the stat module.
(cherry picked from commit 7bb14316b8)

Co-authored-by: Ronan Lamy <ronan.lamy@gmail.com>
2019-10-10 15:50:32 +02:00
Pablo Galindo 0bd9fac7a8 [3.8] bpo-38379: don't claim objects are collected when they aren't (GH-16658) (GH-16683)
* [bpo-38379](https://bugs.python.org/issue38379):  when a finalizer resurrects an object,
nothing is actually collected in this run of gc.
Change the stats to relect that truth.
(cherry picked from commit ecbf35f933)

Co-authored-by: Tim Peters <tim.peters@gmail.com>





https://bugs.python.org/issue38379



Automerge-Triggered-By: @pablogsal
2019-10-09 14:25:06 -07:00
Miss Islington (bot) 359a1975cb
bpo-37531: regrtest ignores output on timeout (GH-16659)
bpo-37531, bpo-38207: On timeout, regrtest no longer attempts to call
`popen.communicate() again: it can hang until all child processes
using stdout and stderr pipes completes. Kill the worker process and
ignores its output.

Reenable test_regrtest.test_multiprocessing_timeout().

bpo-37531: Change also the faulthandler timeout of the main process
from 1 minute to 5 minutes, for Python slowest buildbots.
(cherry picked from commit 0ec618af98)

Co-authored-by: Victor Stinner <vstinner@python.org>
2019-10-09 07:02:15 -07:00
Vinay Sajip d004a5b082
bpo-38368: Added fix for ctypes crash when handling arrays in structs/unions. (GH-16589) (GH-16671)
(cherry picked from commit e8bedbddad)
2019-10-09 06:47:57 +01:00
Pablo Galindo 526ef856dd
[3.8] bpo-38395: Fix ownership in weakref.proxy methods (GH-16632) (GH-16662)
The implementation of weakref.proxy's methods call back into the Python
API using a borrowed references of the weakly referenced object
(acquired via PyWeakref_GET_OBJECT). This API call may delete the last
reference to the object (either directly or via GC), leaving a dangling
pointer, which can be subsequently dereferenced.

To fix this, claim a temporary ownership of the referenced object when
calling the appropriate method. Some functions because at the moment they
do not need to access the borrowed referent, but to protect against
future changes to these functions, ownership need to be fixed in
all potentially affected methods..
(cherry picked from commit 10cd00a9e3)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2019-10-08 21:38:11 +01:00
Miss Islington (bot) 7162440a72
bpo-38407: Add docstrings for typing.SupportsXXX classes. (GH-16644)
(cherry picked from commit 8252c52e57)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2019-10-08 07:14:57 -07:00
Miss Islington (bot) 10b475a151
bpo-38405: Make nested subclasses of typing.NamedTuple pickleable. (GH-16641)
(cherry picked from commit 13abda4100)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2019-10-08 07:12:38 -07:00
Miss Islington (bot) a1f45008f1
bpo-36698: IDLE no longer fails when write non-encodable characters to stderr. (GH-16583)
It now escapes them with a backslash, as the regular Python interpreter.
Added the "errors" field to the standard streams.
(cherry picked from commit b690a2759e)

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

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

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

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

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2019-10-04 03:28:54 -07:00
Miss Islington (bot) 8edde5caab
bpo-34344 Fix AbstractEventLoopPolicy.get_event_loop docstring (GH-16463)
(cherry picked from commit b23a8423a9)

Co-authored-by: idomic <michael.ido@gmail.com>
2019-10-03 14:26:57 -07:00
Miss Islington (bot) 6067e1d2be
bpo-38355: Fix ntpath.realpath failing on sys.executable (GH-16551)
(cherry picked from commit a0e3d27e4e)

Co-authored-by: Steve Dower <steve.dower@python.org>
2019-10-03 08:49:56 -07:00
Victor Stinner de3195c937
[3.8] bpo-36670, regrtest: Fix WindowsLoadTracker() for partial line (GH-16550) (GH-16560)
* bpo-36670, regrtest: Fix WindowsLoadTracker() for partial line (GH-16550)

WindowsLoadTracker.read_output() now uses a short buffer for
incomplete line.

(cherry picked from commit 3e04cd268e)

* bpo-36670: Enhance regrtest WindowsLoadTracker (GH-16553)

The last line is now passed to the parser even if it does not end
with a newline, but only if it's a valid value.

(cherry picked from commit c65119d5bf)

* bpo-36670: Enhance regrtest (GH-16556)

* Add log() method: add timestamp and load average prefixes
  to main messages.
* WindowsLoadTracker:

  * LOAD_FACTOR_1 is now computed using SAMPLING_INTERVAL
  * Initialize the load to the arithmetic mean of the first 5 values
    of the Processor Queue Length value (so over 5 seconds), rather
    than 0.0.
  * Handle BrokenPipeError and when typeperf exit.

* format_duration(1.5) now returns '1.5 sec', rather than
  '1 sec 500 ms'

(cherry picked from commit 098e25672f)
2019-10-03 17:26:25 +02:00
Miss Islington (bot) 183733dfb6
bpo-38338, test.pythoninfo: add more ssl infos (GH-16539)
test.pythoninfo now logs environment variables used by OpenSSL and
Python ssl modules, and logs attributes of 3 SSL contexts
(SSLContext, default HTTPS context, stdlib context).
(cherry picked from commit b3e7045f83)

Co-authored-by: Victor Stinner <vstinner@python.org>
2019-10-02 09:52:50 -07:00
Miss Islington (bot) a72de93388
bpo-36670: regrtest bug fixes (GH-16537)
* Fix TestWorkerProcess.__repr__(): start_time is only valid
  if _popen is not None.
* Fix _kill(): don't set _killed to True if _popen is None.
* _run_process(): only set _killed to False after calling
  run_test_in_subprocess().
(cherry picked from commit 2ea71a07d0)

Co-authored-by: Victor Stinner <vstinner@python.org>
2019-10-02 04:54:18 -07:00
Łukasz Langa 34214de6ab
v3.8.0rc1 2019-10-01 14:58:26 +02:00
Miss Islington (bot) 6b4c70abca
bpo-36670: Multiple regrtest bugfixes (GH-16511)
* Windows: Fix counter name in WindowsLoadTracker. Counter names are
  localized: use the registry to get the counter name. Original
  change written by Lorenz Mende.
* Regrtest.main() now ensures that the Windows load tracker is also
  killed if an exception is raised
* TestWorkerProcess now ensures that worker processes are no longer
  running before exiting: kill also worker processes when an
  exception is raised.
* Enhance regrtest messages and warnings: include test name,
  duration, add a worker identifier, etc.
* Rename MultiprocessRunner to TestWorkerProcess
* Use print_warning() to display warnings.

Co-Authored-By: Lorenz Mende <Lorenz.mende@gmail.com>
(cherry picked from commit 982bfa4da0)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2019-10-01 03:47:52 -07:00
Miss Islington (bot) 938c00ca9e bpo-38319: Fix shutil._fastcopy_sendfile(): set sendfile() max block size (GH-16491) (#16506)
(cherry picked from commit 94e165096f)

Co-authored-by: Giampaolo Rodola <g.rodola@gmail.com>
2019-10-01 09:55:02 +02:00
Miss Islington (bot) 2f644c0dc9 Fix and improve `asyncio.run()` docs (GH-16403) (GH-16504)
(cherry picked from commit e407013089)

Co-authored-by: Kyle Stanley <aeros167@gmail.com>
2019-09-30 18:46:43 -07:00
Christian Heimes bfca56b3dd [3.8] bpo-38270: More fixes for strict crypto policy (GH-16418) (#16437)
test_hmac and test_hashlib test built-in hashing implementations and
OpenSSL-based hashing implementations. Add more checks to skip OpenSSL
implementations when a strict crypto policy is active.

Use EVP_DigestInit_ex() instead of EVP_DigestInit() to initialize the
EVP context. The EVP_DigestInit() function clears alls flags and breaks
usedforsecurity flag again.

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

https://bugs.python.org/issue38270.
(cherry picked from commit 9055815809)

Co-authored-by: Christian Heimes <christian@python.org>
2019-09-30 09:10:38 +02:00
Miss Islington (bot) 2f87a7dc5a bpo-30773: Fix ag_running; prohibit running athrow/asend/aclose in parallel (GH-7468) (#16486)
(cherry picked from commit fc4a044a3c)

Co-authored-by: Yury Selivanov <yury@magic.io>
2019-09-29 23:19:02 -07:00
Yury Selivanov 1c19d656a7
bpo-38242: Revert "bpo-36889: Merge asyncio streams (GH-13251)" (#16482) (#16485)
See https://bugs.python.org/issue38242 for more details
2019-09-29 22:30:17 -07:00
Lisa Roach 21f24ead90
[3.8] bpo-38163: Child mocks detect their type as sync or async (GH-16471) (GH-16484) 2019-09-29 22:22:44 -07:00
Miss Islington (bot) 36e7e4aabb bpo-38161: Removes _AwaitEvent from AsyncMock. (GH-16443) (GH-16481) 2019-09-29 21:23:33 -07:00
Miss Islington (bot) b76ab35240 bpo-38108: Makes mock objects inherit from Base (GH-16060) (GH-16470) 2019-09-29 21:02:46 -07:00
Miss Islington (bot) c9ed9e6fc7
bpo-38317: Fix PyConfig.warnoptions priority (GH-16478)
Fix warnings options priority: PyConfig.warnoptions has the highest
priority, as stated in the PEP 587.

* Document options order in PyConfig.warnoptions documentation.
* Make PyWideStringList_INIT macro private: replace "Py" prefix
  with "_Py".
* test_embed: add test_init_warnoptions().
(cherry picked from commit fb4ae152a9)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2019-09-29 16:58:57 -07:00
Miss Islington (bot) 19cd5951ec
bpo-38019: correctly handle pause/resume reading of closed asyncio unix pipe (GH-16472)
(cherry picked from commit 58498bc717)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
2019-09-29 05:20:15 -07:00
Gregory P. Smith 36c6fa9680
bpo-38115: Deal with invalid bytecode offsets in lnotab (GH-16079) (GH-16464)
Document that lnotab can contain invalid bytecode offsets (because of
terrible reasons that are difficult to fix). Make dis.findlinestarts()
ignore invalid offsets in lnotab. All other uses of lnotab in CPython
(various reimplementations of addr2line or line2addr in Python, C and gdb)
already ignore this, because they take an address to look for, instead.

Add tests for the result of dis.findlinestarts() on wacky constructs in
test_peepholer.py, because it's the easiest place to add them.

(cherry picked from commit c8165036f3)
2019-09-28 08:22:00 -07:00
Miss Islington (bot) 8f478b489a
bpo-38216, bpo-36274: Allow subclasses to separately override validation and encoding behavior (GH-16448)
* bpo-38216: Allow bypassing input validation

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

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

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

* Remove obsolete comment.

* Make _prepare_path_encoding its own attr.

This makes overriding just that simpler.

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

* Add a news entry.

* _prepare_path_encoding -> _encode_prepared_path()

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

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
2019-09-28 07:23:34 -07:00
Lisa Roach 52bdd414ed
[3.8] bpo-38136: Updates await_count and call_count to be different things (GH-16192) (GH-16431) 2019-09-27 15:44:34 -07:00
Miss Islington (bot) 6447b9f9bd
bpo-38243, xmlrpc.server: Escape the server_title (GH-16373)
Escape the server title of xmlrpc.server.DocXMLRPCServer
when rendering the document page as HTML.
(cherry picked from commit e8650a4f8c)

Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
2019-09-27 13:19:41 -07:00
Miss Islington (bot) b2c2a0c02c
cleanup ababstractproperty in typing.py (GH-16432)
(cherry picked from commit 6ce03ec627)

Co-authored-by: HongWeipeng <961365124@qq.com>
2019-09-27 01:13:38 -07:00
Christian Heimes 1931132db3
[3.8] bpo-38275: Skip ssl tests for disabled versions (GH-16386) (GH-16425)
test_ssl now handles disabled TLS/SSL versions better. OpenSSL's crypto
policy and run-time settings are recognized and tests for disabled versions
are skipped.

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

https://bugs.python.org/issue38275
(cherry picked from commit df6ac7e2b8)
2019-09-26 22:53:09 +02:00
Miss Islington (bot) c989340065
bpo-38239: Fix test_gdb for Link Time Optimization (LTO) (GH-16422)
(cherry picked from commit 64b4a3a2de)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2019-09-26 08:13:39 -07:00