Commit Graph

45413 Commits

Author SHA1 Message Date
Steve Dower 135de08128
bpo-41490: Update ensurepip to install pip 20.2.1 and setuptools 49.2.1 (GH-21775) 2020-08-07 23:10:32 +01:00
Miss Islington (bot) 87bc22051f
bpo-41473: Skip test_gdb with gdb 9.2 to work around gdb bug (GH-21768)
gdb 9.2 on Fedora Rawhide is not reliable, see:

* https://bugs.python.org/issue41473
* https://bugzilla.redhat.com/show_bug.cgi?id=1866884
(cherry picked from commit e27a51c11e)

Co-authored-by: Victor Stinner <vstinner@python.org>
2020-08-07 09:15:37 -07:00
Miss Islington (bot) b5789a7419
bpo-41482: Fix error in ipaddress.IPv4Network docstring (GH-21736)
(cherry picked from commit 52f98424a5)

Co-authored-by: Eric L. Frederich <eric.frederich@gmail.com>
2020-08-05 14:43:16 -07:00
Batuhan Taskaya b24c9d2b06
[3.8] bpo-40726: handle uninitalized end_lineno on ast.increment_lineno (GH-21745)
…no (GH-20312).

(cherry picked from commit 8f4380d2f5)

Co-authored-by: Batuhan Taskaya <batuhanosmantaskaya@gmail.com>

Automerge-Triggered-By: @pablogsal
2020-08-05 11:37:19 -07:00
Miss Islington (bot) b934d832d1
bpo-41467: Fix asyncio recv_into() on Windows (GH-21720)
On Windows, fix asyncio recv_into() return value when the socket/pipe
is closed (BrokenPipeError): return 0 rather than an empty byte
string (b'').
(cherry picked from commit 602a971a2a)

Co-authored-by: Victor Stinner <vstinner@python.org>
2020-08-03 17:58:06 -07:00
Miss Islington (bot) 104adedf64
bpo-41384: Raise TclError in tkinter.OptionMenu (GH-21601)
... when an unknown option is passed.  TypeError was being raised because a 2to3 fix was missing.

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
(cherry picked from commit f1d40f941a)
Co-authored-by: Akuli <akuviljanen17@gmail.com>
2020-07-26 22:14:49 -04:00
Miss Islington (bot) 33cebe0b9a
bpo-41385: Fix test_executable_without_cwd on Windows (GH-21608)
(cherry picked from commit b1a87300a0)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2020-07-26 00:38:48 -07:00
Miss Islington (bot) b99f770230
bpo-41314: fixed annotations __future__ version (GH-21616)
PEP 563 was updated to change the release where `from __future__ import annotations` becomes the default (and only) behavior from 4.0 to 3.10. Update `__future__.py` and its docs to reflect this.
(cherry picked from commit 0028c14073)

Co-authored-by: YoSTEALTH <35307184+YoSTEALTH@users.noreply.github.com>
2020-07-25 15:00:17 -07:00
Miss Islington (bot) 949cf93f8e
bpo-38731: Fix NameError in command-line interface of py_compile (GH-21617)
(cherry picked from commit 2024d7aca1)

Co-authored-by: Berker Peksag <berker.peksag@gmail.com>
2020-07-26 00:03:50 +03:00
Terry Jan Reedy a667e1c66a
[3.8] bpo-37309: NEWS for #41373 (GH-21612)
Cherry-picked from  af08db7.
2020-07-25 00:33:01 -04:00
Miss Islington (bot) 1c562ced21
bpo-41373: IDLE: Fix saving files loaded with no newlines or mixed newlines (GH-21597)
Fixes regression in 3.8.4 and 3.9.0b4.

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

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2020-07-24 20:38:46 -07:00
Terry Jan Reedy 29df301a92
[3.8] bpo-4630: Fix errors in Lib/idlelib/NEWS.txt (GH-21594)
Also one in news log.

(cherry picked from commit 592527f3ee)
Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2020-07-23 04:18:03 -04:00
Steve Dower a18f22ab11
bpo-41364: Reduce import overhead of uuid module (GH-21586) 2020-07-22 12:26:37 +01:00
Łukasz Langa 580fbb018f
Python 3.8.5
Contains security fixes for CVE-2019-20907, CVE-2020-15801, and BPO-39603.
2020-07-20 15:01:32 +02:00
Miss Islington (bot) 58f59a9621
bpo-37703: improve asyncio.gather documentation regarding cancellation (GH-15312)
These changes updates the doc to comprehensively mention the behaviour of gather.cancel()

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

Co-authored-by: Vinay Sharma <vinay04sharma@icloud.com>
2020-07-20 02:00:51 -07:00
Miss Islington (bot) 38d930f2cc
bpo-41295: Reimplement the Carlo Verre "hackcheck" (GH-21528)
Walk down the MRO backwards to find the type that originally defined the final `tp_setattro`, then make sure we are not jumping over intermediate C-level bases with the Python-level call.

Automerge-Triggered-By: @gvanrossum
(cherry picked from commit c53b310e59)

Co-authored-by: scoder <stefan_ml@behnel.de>
2020-07-18 14:37:43 -07:00
Miss Islington (bot) 668d321476
bpo-39603: Prevent header injection in http methods (GH-18485)
reject control chars in http method in http.client.putrequest to prevent http header injection
(cherry picked from commit 8ca8a2e8fb)

Co-authored-by: AMIR <31338382+amiremohamadi@users.noreply.github.com>
2020-07-18 13:39:12 -07:00
Miss Islington (bot) ffeb920254
[3.8] bpo-41300: IDLE - save files with non-ascii chars (GH-21512)
Fix regression released in 3.9.0b4 and 3.8.4.
(cherry picked from commit 38d3864efe)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2020-07-16 18:47:52 -04:00
Miss Islington (bot) 3b6a8d2455
bpo-41304: Ensure python3x._pth is loaded on Windows (GH-21495)
(cherry picked from commit 936a660945)

Co-authored-by: Steve Dower <steve.dower@python.org>
2020-07-15 15:15:37 -07:00
Miss Islington (bot) c55479556d
[3.8] bpo-39017: Avoid infinite loop in the tarfile module (GH-21454) (GH-21483)
Avoid infinite loop when reading specially crafted TAR files using the tarfile module
(CVE-2019-20907).
(cherry picked from commit 5a8d121a1f)


Co-authored-by: Rishi <rishi_devan@mail.com>

Automerge-Triggered-By: @encukou
2020-07-15 05:30:53 -07:00
Łukasz Langa 0277b914ca Python 3.8.4
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEE4/8oOcBIslwITevpsmmV4xAlBWgFAl8MT5gACgkQsmmV4xAl
 BWg0CA//Q+aC/BwXrpPrUfgFAGF1UlwxkRlaEfDRvA+Yip3mo2QR005w4xfxkrzS
 8A0PNWOMH/nbmGabmZ/2xZH4ntOvjy2/+5Bcmj1tqNuDOc1gUqywuQ9MtDmW6w+6
 oZ7NE/m948NJwlnoreJCOuFUqXsjtMtnGVfJWs8+Fb7kjZJW3MOytEScVku3434Y
 5/DMrs3kzQxAag2L5GqdUoA7rrdjpzSfMV25ZOeZAd41kZ2/4DqC22PfOp8ApmDA
 /cpeE9tuhHlHz3139bi89F584ZHW+EW7zSNtmBduMPVb1TPS+26oHw44MJ3hJBRK
 tpTtHQytISIRhS4r4iERd26QngbN2tsN7eQZbq4p5ilCx29+7p6ekeWEzNJgvl6O
 Lg9FN62nVacvJqpaa0DZTSUmP/rlCciZFIz+r2Yar0Z2y+Bv2s1IGu6TL0pk96d7
 NpnxvD2EUhN0DpjIm98QhaSeElfqdDTkLRsh6M0bhgiGwvQsVk+wXjNgysuDR3wR
 uXSmO7dBgicKdGpdXX9fd1p8Ind4ibyuD7XxvWRzsMxRm5GQgigEKt9IAXrrkf9n
 r/07AvKbJj8nf9y7SwleUPsaplsrbP0FALmHwkzDQeGA6nbwphRon6bkWQtHMWhu
 kIZJYpGhs0wqnGzylgkI1d5cyXlcok2JbH1D4PALbvkX0tKDN/0=
 =vlbw
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQJEBAABCAAuFiEE4/8oOcBIslwITevpsmmV4xAlBWgFAl8MyOsQHGx1a2FzekBs
 YW5nYS5wbAAKCRCyaZXjECUFaFdlD/sEkprGVKulgfYim0D18Al+0T/LjKRa2wMy
 FHehobDCtKtJDI1jSwbXmlajbid7LHlPBJ6x6pHX7JElXVUQmGsOey1xhqO0Zkkz
 xlbwnZmVby0sco8Mp+5tY+UWkxJX6KlYwqaJ8GLhzsmrhj3YZP1DeUCJr5t4mGjV
 gfFB1NY+5x3XbA2F8op8AASUb2djxbhKc9FPzT6e3+XgMHHSMMZZ60atwmoM0CFw
 9NWCxBteOsUGnhj1UTk4Cbh8Bmpf/4l6kQpIyo4lxiplox99LmE52z4nXgZsHjDs
 UMePNJeYtEsLRZoz9N0FZn/RU4oux2I86qqs6gQPh8Sg23TlP7XHBN4Gav+Lj9Sv
 CWl999p/MFduBRXCyNJKeUmSi2wawnBnT2vk3XFadLdfnM8UWU7JvtjBmki/YOQK
 D9mAXzOgDMpnah4ora2YeS554OxwxbIyJlf2PilRL6MMZ7mSqpndEYvFPd9yeIoK
 HWTKpyTM3W1UOAAZzs09UdOg17Aq1Ei6jLaeEm2uI3mvCP6YUlcQxZVSq5GVkaR1
 eB8JB5plCdM83mrP+9XPXCD+MPaO5V0L+1O2lxcJuwVl4kRKW6tsA6NoDbRqLdk+
 EnlryOAALHbk3aDD/J+qhfjNgPsfeuJLC9nvB6IkUWw57TcjKWReVHLhELfUmOkO
 3EP8tA3k9w==
 =YNqk
 -----END PGP SIGNATURE-----

Merge tag 'v3.8.4' into 3.8

Python 3.8.4
2020-07-13 22:49:45 +02:00
Miss Islington (bot) f56c75ed53
bpo-41288: Fix a crash in unpickling invalid NEWOBJ_EX. (GH-21458)
Automerge-Triggered-By: @tiran
(cherry picked from commit 4f309abf55)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2020-07-13 06:05:44 -07:00
Łukasz Langa dfa645a65e
Python 3.8.4 2020-07-13 14:11:53 +02:00
Miss Islington (bot) 3d1c06e8b9
bpo-37765: Add keywords to IDLE tab completions (GH-15138)
Keywords are present in the main module tab completion lists generated by rlcompleter, which is used by REPLs on *nix. Add all keywords to IDLE's main module name list except those already added from builtins (True, False, and None) . This list may also be used by Show Completions on the Edit menu, and its hot key.

Rewrite Completions doc.

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
(cherry picked from commit bce2eb4646)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2020-07-09 15:54:44 -07:00
Miss Islington (bot) c1c5034593
bpo-40597: Allow email.contextmanager set_content() to set a null string. (GH-20542)
(cherry picked from commit 4fa61a7732)

Co-authored-by: Mark Sapiro <mark@msapiro.net>
2020-07-08 14:18:38 -07:00
Miss Islington (bot) b71ff9a5b6
bpo-41218: Improve the test cases for test_compile_top_level_await_no_coro (GH-21363)
(cherry picked from commit c2c1f1f906)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2020-07-06 16:30:46 -07:00
Miss Islington (bot) 41db8ffc59
bpo-41218: Only mark async code with CO_COROUTINE. (GH-21357)
3.8.3 had a regression where compiling with
ast.PyCF_ALLOW_TOP_LEVEL_AWAIT woudl agressively mark things are
coroutine even if there were not.
(cherry picked from commit bd46174a5a)

Co-authored-by: Matthias Bussonnier <bussonniermatthias@gmail.com>
2020-07-06 14:44:16 -07:00
Miss Islington (bot) aa7f775614
bpo-29778: Ensure python3.dll is loaded from correct locations when Python is embedded (GH-21297) (GH-21352)
Also enables using debug build of `python3_d.dll`
Reference: CVE-2020-15523
(cherry picked from commit dcbaa1b49c)

Co-authored-by: Steve Dower <steve.dower@python.org>
2020-07-06 19:12:16 +02:00
scoder 8912c18245
bpo-39960: Allow heap types in the "Carlo Verre" hack check that override "tp_setattro()" (GH-21092) (GH-21339)
Backport to Py3.8.
2020-07-05 22:12:04 +02:00
Steve Dower b9e288cc1b
bpo-41162: Clear audit hooks later during finalization (GH-21222)
Co-authored-by: Konge <zkonge@outlook.com>
2020-07-04 00:04:22 +01:00
Miss Islington (bot) 53d2b715d1
bpo-41193: Ignore OSError in readline write_history() (GH-21279)
The write_history() atexit function of the readline completer now
ignores any OSError to ignore error if the filesystem is read-only,
instead of only ignoring FileNotFoundError and PermissionError.
(cherry picked from commit 0ab917e07e)

Co-authored-by: Victor Stinner <vstinner@python.org>
2020-07-02 04:02:08 -07:00
Serhiy Storchaka e73896241e
[3.8] bpo-41043: Escape literal part of the path for glob(). (GH-20994). (GH-21277)
(cherry picked from commit 9355868458)
2020-07-02 10:05:35 +03:00
Miss Islington (bot) c3fa7534c7
bpo-41158: IDLE: rewrite the code for handling file encoding (GH-21215)
(cherry picked from commit 694d31e714)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2020-07-01 11:22:45 -07:00
Łukasz Langa 26d1d1dcfd Python 3.8.4rc1
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEE4/8oOcBIslwITevpsmmV4xAlBWgFAl76bPYACgkQsmmV4xAl
 BWjLjQ//To/nYZE1CLt2eKmCM1T1ot2FZJVunXl6en48d9T4xosDhlZNU2SvHEWM
 BU9tf47r8s0UYCihMUAKL7RzYSh0LuEdlG9/3n9X8LH8glMyQAXAXDJNOK0Zeyxz
 n63UpIBgwHXSzSbJ4HsiFViJ8m6RkBO2OH7pe8l0S5022mi1SVmfNZQ3epDsz0HC
 z4kIgB4v/q549hdME/w5HVU4gPyhIlsLsSzdikWtPxp19Y+ZEYX3q6myV8OXU6bZ
 vBEEQWCvmJkCVxDFgHqHIKiYE847BbN9K6N+XOo1YkQ9LCLKPMRwiLIvUGjlx3Mh
 wfEsfNgVfrJTHi5+o8z5EMO6gAY5+kkdmd/y3YmPBmdm/7f+jEK67RNfDnjjjPTD
 cc/ayRSpK3ffR/jMXNqBqzTRsqt13YddW7Xuy5Jm+N/1VB2D7D83y6yddlHyatUo
 FKbT6MjgEEfKh5uZOX6929DBicZLPU/nGK3X1gWE7DUSmk612ZAUWOv922g7SIWz
 GjEqmm1/+41sCJHJGyqbcuU3kaQtzY81VCNVjosT/vq9mTDLJvDG7/utni5Ii0N7
 PV4XDxo2ygOG7+SVQIG+LN168k8whIF4O+hDoHjQp1YHQoV/SW5NXx87ZIEJyhpJ
 ov7DpZbOvld3oCeL1YdqeUM6krU/gbnJcj2Ex+Isw3SHbDNhJTA=
 =fOMA
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQJEBAABCAAuFiEE4/8oOcBIslwITevpsmmV4xAlBWgFAl77Yj0QHGx1a2FzekBs
 YW5nYS5wbAAKCRCyaZXjECUFaI80D/9PJBQl4MZUZvLAakTU2TxH4Q5Thhd0KXya
 yMMAWqPPaY8VhVR3MUZ3urQ29NA2lLztGx7TAEn0vW5FsmyVAlqD8qHAAZaAAWP6
 0ULcuntNGq8tDMNbNnhc5ZAe8HWMUnIFbGaCY/8RBtMz+yi3xYNvUkV5/F0T7wNn
 9yOGfzExTjOVpv5QTGducoedDpvQ8y/2dIclLBBDDCchoQLBPP6wQyAnVh/exh3K
 ddgAeGhRCcp7YbVk4iHv14+4pNBOatiy5scfXu1Dkl/8id0UnAmpKsmiS0zNQn05
 ox8bx+RNJMxR0CSIFMejA2qhYKMqTbcJ8A6Y2r7tN3mNLnGSChaKGR4gdXXqTfHS
 OYsTnML68zyoo55R5Ggn0Eem1BwZT1FUD7eiV7WalfgPx4sZNqOcqUb9qN41P/Cm
 /9NYV+N4j+IUHSUPXzcSpP7iBajdUIjyfUO5E9rgIS/6MHkT5ZqDTZCWbyYCySzm
 lbdeKx3XY15ZLFiTfQnuEZw5eJ7UyQzTqphKlY6i6NGpZxiw9yZGv/P5NIqw/txz
 a4btDjUGDaxJmg/rdZ6I8TV2ZOKCHo/qpFpEULD0OaMAMBjlzPNsMAyOkcdtUAhv
 ZcJRK7OfGK7MPVQOYpws5NNmXCAnkdqFq9IgW/wV1AICoCBYrPBbsyt+ZScMjS8+
 WeB+W9F3pQ==
 =DdsK
 -----END PGP SIGNATURE-----

Merge tag 'v3.8.4rc1' into 3.8

Python 3.8.4rc1
2020-06-30 18:03:07 +02:00
Miss Islington (bot) 00fd04b9b7
bpo-41152: IDLE: always use UTF-8 for standard IO streams (GH-21214)
(cherry picked from commit 2515a28230)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2020-06-29 17:39:02 -07:00
Łukasz Langa 6c38841c08
Python 3.8.4rc1 2020-06-30 00:30:11 +02:00
Miss Islington (bot) dc8ce8ead1
bpo-41004: Resolve hash collisions for IPv4Interface and IPv6Interface (GH-21033)
The __hash__() methods of classes IPv4Interface and IPv6Interface had issue
of generating constant hash values of 32 and 128 respectively causing hash collisions.
The fix uses the hash() function to generate hash values for the objects
instead of XOR operation
(cherry picked from commit b30ee26e36)

Co-authored-by: Ravi Teja P <rvteja92@gmail.com>
2020-06-29 11:12:50 -07:00
Miss Islington (bot) 7731139b7a
bpo-41048: mimetypes should read the rule file using UTF-8, not the locale encoding (GH-20998)
(cherry picked from commit 7f569c9bc0)

Co-authored-by: Srinivas Reddy Thatiparthy (శ్రీనివాస్  రెడ్డి తాటిపర్తి) <thatiparthysreenivas@gmail.com>
2020-06-29 05:07:41 -07:00
Serhiy Storchaka cb53b8ce9c
[3.8] bpo-41138: Fix trace CLI for non-UTF-8 files. (GH-21177) (GH-21200)
Fix also a resource warning when store counts and module info.
(cherry picked from commit 04cdeb7a56)
2020-06-28 17:30:08 +03:00
Miss Islington (bot) 86ef6fe2b6
bpo-41144: Fix IDLE open module error (GH-21182)
Could not open os.path.

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

Co-authored-by: E-Paine <63801254+E-Paine@users.noreply.github.com>
2020-06-27 23:20:13 -07:00
Guido van Rossum e653369e76
[3.8] bpo-35975: Only use cf_feature_version if PyCF_ONLY_AST in cf_flags (#21023) 2020-06-27 17:35:05 -07:00
Christian Heimes 8075fe199b
[3.8] bpo-41009: fix requires_OS_version() class decorator (GH-20942) (GH-20948)
Signed-off-by: Christian Heimes <christian@python.org>

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

Co-authored-by: Christian Heimes <christian@python.org>
2020-06-25 05:18:43 -07:00
Miss Islington (bot) f547d06ea7
bpo-41113: Fix test_warnings on non-Western locales. (GH-21143)
(cherry picked from commit 0f8ec1fff0)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2020-06-25 05:04:56 -07:00
Miss Islington (bot) 84f9c23a12
bpo-35773: Fix test_bdb on non-UTF-8 locales. (GH-21136)
(cherry picked from commit 94eee69e9b)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2020-06-25 04:37:38 -07:00
Miss Islington (bot) 3f4de44cf7
bpo-41074: Fix support of non-ASCII names and SQL in msilib. (GH-21126)
* Fix support of non-ASCII names in functions OpenDatabase()
  and init_database().
* Fix support of non-ASCII SQL in method Database.OpenView().
(cherry picked from commit 55939b1708)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2020-06-25 02:12:41 -07:00
Miss Islington (bot) 1dda40c1d2
bpo-41094: Additional fix for PYTHONSTARTUP. (GH-21119)
(cherry picked from commit a7dc714701)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2020-06-24 10:03:51 -07:00
Miss Islington (bot) 1813d318fd
bpo-41094: Fix decoding errors with audit when open files. (GH-21095)
(cherry picked from commit 6c6810d989)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2020-06-24 09:45:38 -07:00
Miss Islington (bot) adf8708c44
bpo-41005: Fixed perrmission error (GH-20936) (GH-21052)
* fixed issue 41005: webbrowser fails when xdg-settings cannot be executed

Co-authored-by: KrishnaSai2020 <krishnasai.chivukula@gmal.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
(cherry picked from commit 9e27bc0c1e)

Co-authored-by: Krishna Chivukula <63070026+KrishnaSai2020@users.noreply.github.com>

Co-authored-by: Krishna Chivukula <63070026+KrishnaSai2020@users.noreply.github.com>
2020-06-24 14:58:27 +02:00
Miss Islington (bot) 0029099dec
Fix typo in dataclasses module (GH-21109) (#21111)
Automerge-Triggered-By: @matrixise
(cherry picked from commit 80526f6841)

Co-authored-by: Jürgen Gmach <juergen.gmach@googlemail.com>

Co-authored-by: Jürgen Gmach <juergen.gmach@googlemail.com>
2020-06-24 07:14:10 -04:00
Miss Islington (bot) d7f37d1ed4
bpo-41068: Fix read after write in zipfile for non-ASCII files names. (GH-21040)
(cherry picked from commit 36ff513f82)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2020-06-22 01:40:05 -07:00
Miss Islington (bot) b99824a8e1
bpo-40824: Do not mask errors in __iter__ in "in" and the operator module. (GH-20537)
Unexpected errors in calling the __iter__ method are no longer
masked by TypeError in the "in" operator and functions
operator.contains(), operator.indexOf() and operator.countOf().
(cherry picked from commit cafe1b6e9d)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2020-06-22 01:21:04 -07:00
Miss Islington (bot) 14195597b3
bpo-41058: Use source file encoding in pdb.find_function(). (GH-21010)
(cherry picked from commit 19fcffa927)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2020-06-21 12:36:23 -07:00
Miss Islington (bot) 80651ab9e3
bpo-41040: Fix test_modulefinder. (GH-20991)
(cherry picked from commit a041e116db)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2020-06-19 14:25:25 -07:00
Miss Islington (bot) ec9bc2da42
bpo-38377: Fix skip_if_broken_multiprocessing_synchronize() on macOS (GH-20984)
skip_if_broken_multiprocessing_synchronize() only attempts for create
a semaphore on Linux to fix multiprocessing
test_resource_tracker_reused() on macOS.
(cherry picked from commit 3358da4054)

Co-authored-by: Victor Stinner <vstinner@python.org>
2020-06-19 09:19:38 -07:00
Miss Islington (bot) 4dd10ed694
Improve readability of `formataddr` docstring (GH-20963)
For me as a non native English speaker, the sentence with its embedded clause was very hard to understand.

modified:   Lib/email/utils.py

Automerge-Triggered-By: @csabella
(cherry picked from commit 66a65ba43c)

Co-authored-by: Jürgen Gmach <juergen.gmach@googlemail.com>
2020-06-19 05:15:57 -07:00
Victor Stinner e8056180a1
bpo-38377: Add support.skip_if_broken_multiprocessing_synchronize() (GH-20944) (GH-20962) (GH-20966)
On Linux, skip tests using multiprocessing if the current user cannot
create a file in /dev/shm/ directory. Add the
skip_if_broken_multiprocessing_synchronize() function to the
test.support module.

(cherry picked from commit ddbeb2f3e0)
(cherry picked from commit b1e7361134)
2020-06-18 18:56:43 +02:00
Victor Stinner 3d974b2fc6
bpo-41003: Fix test_copyreg when numpy is installed (GH-20935) (GH-20945) (GH-20946)
Fix test_copyreg when numpy is installed: test.pickletester now
saves/restores warnings.filters when importing numpy, to ignore
filters installed by numpy.

Add the save_restore_warnings_filters() function to the
test.support.warnings_helper module.

(cherry picked from commit 8362893e3f)
(cherry picked from commit b39d41ba1b)
2020-06-17 19:09:49 +02:00
Ned Deily e63cc2f646
bpo-38488: Upgrade bundled versions of pip & setuptools (GH-20491) (GH-20900)
Co-authored-by: Xavier Fernandez <xav.fernandez@gmail.com>
2020-06-15 17:42:22 -04:00
Miss Islington (bot) a1d3be4623
bpo-40448: ensurepip: Do not use cache (GH-19812)
ensurepip optionally installs or upgrades 'pip' and 'setuptools' using
the version of those modules bundled with Python.  The internal PIP
installation routine by default temporarily uses its cache, if it
exists.  This is undesirable as Python builds and installations may be
independent of the user running the build, whilst PIP cache location
is dependent on the user's environment and outside of the build
environment.

At the same time, there's no value in using the cache while installing
bundled modules.

This change disables PIP caching when used in ensurepip.
(cherry picked from commit 4a3a682b12)

Co-authored-by: Krzysztof Konopko <kkonopko@users.noreply.github.com>
2020-06-15 10:45:21 -07:00
Miss Islington (bot) c72b7f703e
bpo-34226: fix cgi.parse_multipart without content_length (GH-8530)
In Python 3.7 the behavior of parse_multipart changed requiring CONTENT-LENGTH
header, this fix remove this header as required and fix FieldStorage
read_lines_to_outerboundary, by not using limit when it's negative,
since by default it's -1 if not content-length and keeps substracting what
was read from the file object.

Also added a test case for this problem.
(cherry picked from commit d8cf3514dd)

Co-authored-by: roger <rogerduran@gmail.com>
2020-06-15 08:51:35 -07:00
Miss Islington (bot) 811e040b6e
bpo-40855: Fix ignored mu and xbar parameters (GH-20835) (GH-20863) 2020-06-13 16:57:17 -07:00
Miss Islington (bot) 26db10a431
bpo-40834: Fix truncate when sending str object with channel (GH-20555)
(cherry picked from commit 29c117202e)

Co-authored-by: An Long <aisk@users.noreply.github.com>
2020-06-13 05:44:50 -07:00
Christian Heimes adce133378
bpo-40964: disable remote IMAP tests (GH-20836)
Remote host cyrus.andrew.cmu.edu is blocking incoming connections and is
causing test suite to fail.

Signed-off-by: Christian Heimes <christian@python.org>
2020-06-12 15:08:32 -04:00
Miss Islington (bot) a3d6d23a92
bpo-40626: Support HDF5 in mimetypes (GH-20042)
Add hdf5 with .h5 file extension

See 'Recommendations' section for mime types from the HDF group:  https://www.hdfgroup.org/2018/06/citations-for-hdf-data-and-software/

Patch by Mark Schwab.
(cherry picked from commit 60c2a810e3)

Co-authored-by: MARK SCHWAB <32745414+schwabm@users.noreply.github.com>
2020-06-11 12:32:37 -07:00
Miss Islington (bot) 3e499cda47
bpo-29620: iterate over a copy of sys.modules (GH-4800) (GH-20816)
unittest.TestCase.assertWarns no longer raises a RuntimeException
when accessing a module's ``__warningregistry__`` causes importation of a new
module, or when a new module is imported in another thread.
(cherry picked from commit 46398fba4d)

Co-authored-by: kernc <kerncece@gmail.com>
2020-06-11 14:31:46 -04:00
Miss Islington (bot) 5b8e3a5335
bpo-34401: Fix test_gdb for HP GDB version string (GH-20804)
The GDB provided by HPE on HP-UX contains a modified version string. Therefore
the tests fail. Adapt the regex to match that string.

Patch by Michael Osipov.

Co-Authored-by: Michael Osipov <michael.osipov@siemens.com>
(cherry picked from commit b2dca49ca3)

Co-authored-by: Victor Stinner <vstinner@python.org>
2020-06-11 07:07:39 -07:00
Victor Stinner c7a6c7b527
bpo-40826: Fix test_repl.test_close_stdin() on Windows (GH-20779) (GH-20785) (GH-20787)
test_repl.test_close_stdin() now calls
support.suppress_msvcrt_asserts() to fix the test on Windows.

* Move suppress_msvcrt_asserts() from test.libregrtest.setup to
  test.support. Make its verbose parameter optional: verbose=False by
  default.
* SuppressCrashReport now uses SetErrorMode() of the msvcrt module,
  rather than using ctypes.
* Remove also an unused variable (deadline) in wait_process().

(cherry picked from commit f6e58aefde)
(cherry picked from commit 4a4f660cfd)
2020-06-10 19:45:47 +02:00
Stefan Krah 0f5a28f834
[3.8] Revert bpo-39576: Prevent memory error for overly optimistic precisions (GH-20747)
This reverts commit b6271025c6.
2020-06-09 01:57:11 +02:00
Miss Islington (bot) 83a9ba4426
bpo-40870: Invalidate usage of some constants with ast.Name (GH-20649)
(cherry picked from commit 68874a8502)

Co-authored-by: Batuhan Taskaya <isidentical@gmail.com>
2020-06-06 10:04:47 -07:00
Shantanu f7ed4d4e83
bpo-40614: Respect feature version for f-string debug expressions (GH-20196) (GH-20466)
Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
Co-authored-by: Pablo Galindo <pablogsal@gmail.com>
(cherry picked from commit c116c94ff1)
2020-06-06 11:08:48 +01:00
Miss Islington (bot) c067183605
bpo-40807: Show warnings once from codeop._maybe_compile (GH-20486)
* bpo-40807: Show warnings once from codeop._maybe_compile

* Move catch_warnings

* news

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

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
2020-06-06 01:24:45 -07:00
Terry Jan Reedy a5d6aba318
[3.8] bpo-40807: Backport test_codeop change [GH-19670]
A tiny sliver of a 3.9 PEG parser patch needed to backport the test added by #20486.
2020-06-04 22:42:44 -04:00
Victor Stinner 6f7346bb39
[3.9] bpo-40826: Fix GIL usage in PyOS_Readline() (GH-20613) (GH-20616)
* bpo-40826: Fix GIL usage in PyOS_Readline() (GH-20579)

Fix GIL usage in PyOS_Readline(): lock the GIL to set an exception.

Pass tstate to my_fgets() and _PyOS_WindowsConsoleReadline(). Cleanup
these functions.

(cherry picked from commit c353764fd5)

* bpo-40826: Add _PyOS_InterruptOccurred(tstate) function (GH-20599)

my_fgets() now calls _PyOS_InterruptOccurred(tstate) to check for
pending signals, rather calling PyOS_InterruptOccurred().

my_fgets() is called with the GIL released, whereas
PyOS_InterruptOccurred() must be called with the GIL held.

test_repl: use text=True and avoid SuppressCrashReport in
test_multiline_string_parsing().

Fix my_fgets() on Windows: fgets(fp) does crash if fileno(fp) is closed.

(cherry picked from commit fa7ab6aa0f)
2020-06-03 18:28:18 +02:00
Miss Islington (bot) 5b8787ef19
bpo-40767: Allow pure Wayland to get default XDG web browser (GH-20382)
Would be nice to backport to python 3.7+. I don't think it's worth the hassle to backport this all the way down to 3.10. But I'll let the maintainers decide.

This is hard to test because the test setup already includes this [environment variable](https://github.com/python/cpython/blob/master/Lib/test/pythoninfo.pyGH-L292)

Let me know if something doesn't match the PR guidelines. This is my first PR in the python source code.
(cherry picked from commit c822efeda9)

Co-authored-by: Jeremy Attali <jeremy.attali@gmail.com>
2020-06-03 06:02:33 -07:00
Miss Islington (bot) 3dcccd1186
bpo-39885: Make IDLE context menu cut and copy work again (GH-18951)
Leave selection when right click within.  This exception to clearing selections when right-clicking was omitted from the previous commit, 4ca060d.  I did not realize that this completely disabled the context menu entries, and  I should have merged a minimal fix immediately.  An automated test should follow.
(cherry picked from commit 97e4e0f53d)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2020-05-29 16:13:00 -07:00
Miss Islington (bot) 00a240bf7f
bpo-40784: Fix sqlite3 deterministic test (GH-20448)
(cherry picked from commit c610d970f5)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
2020-05-29 05:46:34 -07:00
Andrew Kuchling b86636bff4
[3.8] bpo-25872: Fix KeyError in linecache when multithreaded (GH-18007) (GH-20092)
Backporting to 3.8 and adding a NEWS item (I should have added one to the master branch -- oh well).
2020-05-29 04:59:44 -07:00
Miss Islington (bot) 6381ee077d
bpo-39040: Fix parsing of email mime headers with whitespace between encoded-words. (gh-17620)
* bpo-39040: Fix parsing of email headers with encoded-words inside a quoted string.

It is fairly common to find malformed mime headers (especially content-disposition
headers) where the parameter values, instead of being encoded to RFC
standards, are "encoded" by doing RFC 2047 "encoded word" encoding, and
then enclosing the whole thing in quotes.  The processing of these malformed
headers was incorrectly leaving the spaces between encoded words in the decoded
text (whitespace between adjacent encoded words is supposed to be stripped on
decoding).  This changeset fixes the encoded word processing inside quoted strings
(bare-quoted-string) to do correct RFC 2047 decoding by stripping that
whitespace.
(cherry picked from commit 21017ed904)

Co-authored-by: Abhilash Raj <maxking@users.noreply.github.com>
2020-05-29 04:43:27 -07:00
Miss Islington (bot) 45ce0dbc4f
bpo-40795: ctypes calls unraisablehook with an exception (GH-20452)
If ctypes fails to convert the result of a callback or if a ctypes
callback function raises an exception, sys.unraisablehook is now
called with an exception set. Previously, the error was logged into
stderr by PyErr_Print().
(cherry picked from commit 10228bad04)

Co-authored-by: Victor Stinner <vstinner@python.org>
2020-05-27 15:56:36 -07:00
Miss Islington (bot) b5ecbf02e4
bpo-40025: Require _generate_next_value_ to be defined before members(GH-19763)
require `_generate_next_value_` to be defined before members
2020-05-27 13:12:08 -07:00
Miss Islington (bot) a285af7e62
bpo-13097: ctypes: limit callback to 1024 arguments (GH-19914)
ctypes now raises an ArgumentError when a callback
is invoked with more than 1024 arguments.

The ctypes module allocates arguments on the stack in
ctypes_callproc() using alloca(), which is problematic
when large numbers of arguments are passed. Instead
of a stack overflow, this commit raises an ArgumentError
if more than 1024 parameters are passed.
(cherry picked from commit 29a1384c04)

Co-authored-by: Sean Gillespie <sean@swgillespie.me>
2020-05-27 08:53:03 -07:00
Miss Islington (bot) 75635c6095
bpo-39073: validate Address parts to disallow CRLF (GH-19007)
Disallow CR or LF in email.headerregistry.Address arguments to guard against header injection attacks.
(cherry picked from commit 614f17211c)

Co-authored-by: Ashwin Ramaswami <aramaswamis@gmail.com>
2020-05-27 06:37:40 -07:00
Miss Islington (bot) 5594c07d97
Clean up compatibility code in importlib fixtures (GH-19156) (#19543)
(cherry picked from commit 574547a75c)

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

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
2020-05-27 09:05:03 -04:00
Miss Islington (bot) 285ff63351
bpo-39244: multiprocessing return default start method first on macOS (GH-18625)
(cherry picked from commit db098bc1f0)

Co-authored-by: idomic <michael.ido@gmail.com>
2020-05-26 08:13:59 -07:00
Zackery Spytz 5ff5edfef6
[3.8] bpo-35714: Reject null characters in struct format strings (GH-16928) (GH-20419)
struct.error is now raised if there is a null character in a struct
format string.
(cherry picked from commit 3f59b55316)
2020-05-26 11:57:09 +03:00
Miss Islington (bot) 5c1d745da5
bpo-39830: Add zipfile.Path to __all__ (GH-19115) (GH-19116)
(cherry picked from commit 9a81ab107a)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2020-05-26 02:44:57 -04:00
Miss Islington (bot) 331b2dfadb
bpo-38972: Fix typos in PowerShell Execution Policies links (GH-20383)
(cherry picked from commit ef16958d17)

Co-authored-by: Miro Hrončok <miro@hroncok.cz>
2020-05-25 08:11:39 -07:00
Miss Islington (bot) 907ee1f14a
bpo-36290: Fix keytword collision handling in AST node constructors (GH-12382)
(cherry picked from commit c73914a562)

Co-authored-by: Rémi Lapeyre <remi.lapeyre@lenstra.fr>
2020-05-24 14:31:47 -07:00
Terry Jan Reedy 1ae0fd87a0
[3.8] bpo-37309: Update IDLE NEWS.txt for 3.8.4 (GH-20355) 2020-05-24 09:57:29 -04:00
Miss Islington (bot) a64df485a4
bpo-40723: Make IDLE autocomplete test run without __main__.__file__ (GH-20311)
This was the only failure running unittest.main(test.test_idle) after imports.
(cherry picked from commit 905b3cd05f)

Co-authored-by: Florian Dahlitz <f2dahlitz@freenet.de>
2020-05-24 04:08:04 -07:00
Batuhan Taskaya a4d219b35e
[3.8] bpo-40663: Correctly handle annotations with subscripts in ast_unparse.c (GH-20156). (GH-20191)
(cherry picked from commit 2135e10dc7)

Co-authored-by: Batuhan Taskaya <batuhanosmantaskaya@gmail.com>
2020-05-22 23:32:40 +01:00
Miss Islington (bot) 0cc7becde0
bpo-40214: Fix ctypes WinDLL test with insecure flags (GH-19652)
(cherry picked from commit 9b49893900)

Co-authored-by: Steve Dower <steve.dower@python.org>
2020-05-22 15:24:45 -07:00
Miss Islington (bot) 16d07812dd
bpo-40327: Improve atomicity, speed, and memory efficiency of the items() loop (GH-19628)
(cherry picked from commit 75bedbe2ed)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
2020-05-22 15:22:51 -07:00
Miss Islington (bot) a59fc9160d
s/wakup/wakeup (GH-20250)
(as title)

Automerge-Triggered-By: @Mariatta
(cherry picked from commit f2947e354c)

Co-authored-by: Kunal Bhalla <bhalla.kunal@gmail.com>
2020-05-20 10:58:55 -07:00
Miss Islington (bot) 94d9c5e5af
bpo-39148: enable ipv6 for datagrams in Proactor (GH-19121)
Ifdef is not necessary, as AF_INET6 is supported from Windows Vista, and other code in overlapped.c uses AF_INET6 and is not ifdef'd.
Change the raised exception so users are not fooled to think it comes from Windows API.

Automerge-Triggered-By: @njsmith
(cherry picked from commit 442634c42f)

Co-authored-by: Kjell Braden <afflux@pentabarf.de>
2020-05-17 23:42:25 -07:00
Miss Islington (bot) c1f1ddf30a
bpo-40597: email: Use CTE if lines are longer than max_line_length consistently (gh-20038) (gh-20084)
raw_data_manager (default for EmailPolicy, EmailMessage)
does correct wrapping of 'text' parts as long as the message contains
characters outside of 7bit US-ASCII set: base64 or qp
Content-Transfer-Encoding is applied if the lines would be too long
without it.  It did not, however, do this for ascii-only text,
which could result in lines that were longer than
policy.max_line_length or even the rfc 998  maximum.

This changeset fixes the heuristic so that if lines are longer than
policy.max_line_length, it will always apply a
content-transfer-encoding so that the lines are wrapped correctly.
(cherry picked from commit 6f2f475d5a)

Co-authored-by: Arkadiusz Hiler <arek.l1@gmail.com>
2020-05-17 20:57:42 -04:00
Miss Islington (bot) c3d025a86a
bpo-40636: Clarify the zip built-in docstring. (GH-20118)
Clarify the zip built-in docstring.

This puts much simpler text up front along with an example.

As it was, the zip built-in docstring was technically correct.  But too
technical for the reader who shouldn't _need_ to know about `__next__` and
`StopIteration` as most people do not need to understand the internal
implementation details of the iterator protocol in their daily life.

This is a documentation only change, intended to be backported to 3.8; it is
only tangentially related to PEP-618 which might offer new behavior options
in the future.

Wording based a bit more on enumerate per Brandt's suggestion.

This gets rid of the legacy wording paragraph which seems too tied to
implementation details of the iterator protocol which isn't relevant here.

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

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2020-05-15 14:43:27 -07:00
Miss Islington (bot) 4e6545b002
bpo-40055: test_distutils leaves warnings filters unchanged (GH-20095)
distutils.tests now saves/restores warnings filters to leave them
unchanged. Importing tests imports docutils which imports
pkg_resources which adds a warnings filter.
(cherry picked from commit 6e57237faf)

Co-authored-by: Victor Stinner <vstinner@python.org>
2020-05-15 09:25:00 -07:00
Miss Islington (bot) eb5ce324f7
bpo-38872: Document exec symbol for codeop.compile_command (GH-20047) (GH-20098)
* Document exec symbol for codeop.compile_command

* Remove extra statements

Co-authored-by: nanjekyejoannah <joannah.nanjekye@ibm.com>
(cherry picked from commit 7ba1f75f3f)

Co-authored-by: Joannah Nanjekye <33177550+nanjekyejoannah@users.noreply.github.com>

Co-authored-by: Joannah Nanjekye <33177550+nanjekyejoannah@users.noreply.github.com>
2020-05-14 22:38:17 -03:00
Łukasz Langa 6f8c8320e9
Python 3.8.3 2020-05-13 19:31:54 +02:00
Miss Islington (bot) a63c611685
bpo-40561: Add docstrings for webbrowser open functions (GH-19999)
Co-authored-by: Brad Solomon <brsolomon@deloitte.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
(cherry picked from commit ef7973a981)

Co-authored-by: Brad Solomon <brad.solomon.1124@gmail.com>
2020-05-11 12:09:10 -07:00
Miss Islington (bot) bce4ddafdd
bpo-40527: Fix command line argument parsing (GH-19955)
(cherry picked from commit 2668a9a5aa)

Co-authored-by: Victor Stinner <vstinner@python.org>
2020-05-06 06:43:09 -07:00
Miss Islington (bot) 2a3b876b02
bpo-40355: Improve error messages in ast.literal_eval with malformed Dict nodes (GH-19868)
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
(cherry picked from commit c21c51235a)

Co-authored-by: Curtis Bucher <cpbucher5@gmail.com>
2020-05-05 13:00:57 -07:00
Miss Islington (bot) efc782d29e
bpo-40459: Fix NameError in platform.py (GH-19855)
(cherry picked from commit 1e7e4519a8)

Co-authored-by: Dennis Sweeney <36520290+sweeneyde@users.noreply.github.com>
2020-05-04 19:51:48 -07:00
Miss Islington (bot) 70fe95cdc9
bpo-40135: Fix multiprocessing test_shared_memory_across_processes() (GH-19892)
Don't define shared memory block's name in test_shared_memory_across_processes():
use SharedMemory(create=True) instead.
(cherry picked from commit caa3ef284a)

Co-authored-by: Hai Shi <shihai1992@gmail.com>
2020-05-04 08:25:22 -07:00
Miss Islington (bot) 399b9a4a62
bpo-40419: timeit CLI docs now mention 1,2,5,10,... trials instead of powers of 10 (GH-19752)
(cherry picked from commit 766352320f)

Co-authored-by: Sander <svr003@gmail.com>
2020-05-02 09:29:51 -07:00
Serhiy Storchaka a629d4c63c
[3.8] bpo-40398: Fix typing.get_args() for special generic aliases. (GH-19720) (GH-19857)
(cherry picked from commit 6292be7adf)
2020-05-02 11:08:00 +03:00
Pablo Galindo 5055c274c6
[3.8] bpo-39562: Prevent collision of future and compiler flags (GH-19230) (GH-19835)
The constant values of future flags in the __future__ module
is updated in order to prevent collision with compiler flags.
Previously PyCF_ALLOW_TOP_LEVEL_AWAIT was clashing
with CO_FUTURE_DIVISION..
(cherry picked from commit 4454057269)

Co-authored-by: Batuhan Taşkaya <batuhanosmantaskaya@gmail.com>
2020-05-01 07:18:27 -07:00
Miss Islington (bot) 95e208dce5
bpo-40443: Remove unused imports in idlelib (GH-19801)
(cherry picked from commit 6900f16d22)

Co-authored-by: Victor Stinner <vstinner@python.org>
2020-04-29 18:47:50 -07:00
Łukasz Langa 802eb676ba
Python 3.8.3rc1 2020-04-29 19:21:55 +02:00
Miss Islington (bot) d9e9049191
bpo-40436: Fix code parsing gdb version (GH-19792)
test_gdb and test.pythoninfo now check gdb command exit code.
(cherry picked from commit ec9bea4a37)

Co-authored-by: Victor Stinner <vstinner@python.org>
2020-04-29 08:30:01 -07:00
Kyle Stanley cc011b5190
[3.8] bpo-40431: Fix syntax typo in turtledemo (GH-19777) (#19784)
[3.8] bpo-40431: Fix syntax typo in turtledemo (GH-19777)

* Addresses a syntax typo that mistakenly used a undefined string prefix due to a missing space.

(cherry picked from commit 49f70db83e)

Co-authored-by: Miro Hrončok <miro@hroncok.cz>
2020-04-28 23:11:18 -04:00
Miss Islington (bot) c7b55e929b
Expand the implementation comments (GH-19699) (GH-19701) 2020-04-24 03:04:41 -07:00
Victor Stinner 3340b2a61b
bpo-39983: Add test.support.print_warning() (GH-19683) (GH-19687)
Log "Warning -- ..." test warnings into sys.__stderr__ rather than
sys.stderr, to ensure to display them even if sys.stderr is captured.

test.libregrtest.utils.print_warning() now calls
test.support.print_warning().

(cherry picked from commit d663d34685)
2020-04-23 23:55:07 +02:00
Miss Islington (bot) fc45cb4400
bpo-40260: Remove unnecessary newline in compile() call (GH-19641)
Because some people subclass this class and call undocumented methods, and we don't want to break them.
(cherry picked from commit 39652cd8bd)

Co-authored-by: Anthony Sottile <asottile@umich.edu>
2020-04-22 12:05:10 -07:00
Miss Islington (bot) 4a6da0b63b
bpo-38360: macOS: support alternate form of -isysroot flag (GH-16480)
It is possible to use either '-isysroot /some/path' (with a space) or
'-isysroot/some/path' (no space in between). Support both forms in
places where special handling of -isysroot is done, rather than just
the first form.
Co-authored-by: Ned Deily <nad@python.org>
(cherry picked from commit b310700976)

Co-authored-by: Joshua Root <jmr@macports.org>
2020-04-22 10:13:47 -07:00
Victor Stinner b07350901c
bpo-40138: Fix Windows os.waitpid() for large exit code (GH-19654)
Fix the Windows implementation of os.waitpid() for exit code
larger than "INT_MAX >> 8". The exit status is now interpreted as an
unsigned number.
2020-04-22 17:57:59 +02:00
Miss Islington (bot) 3a55450256
bpo-38439: Add 256px IDLE icon (GH-17473)
Icon author: Andrew Clover, bpo-1490384
(cherry picked from commit 3a69f3caee)

Co-authored-by: Miro Hrončok <miro@hroncok.cz>
2020-04-22 00:39:59 -07:00
Miss Islington (bot) 41660cac63
bpo-39942:Fix failure in `TypeVar` when missing `__name__` (GH-19616)
https://bugs.python.org/issue39942
(cherry picked from commit a25a04fea5)

Co-authored-by: HongWeipeng <hongweichen8888@sina.com>
2020-04-20 13:24:35 -07:00
Antoine Pitrou 887ff8e37e
[3.8] bpo-40330: Fix utf-8 size check in ShareableList (GH-19606) (GH-19625)
The item size must be checked after encoding to bytes, not before.

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

Co-authored-by: Antoine Pitrou <antoine@python.org>
2020-04-20 21:22:50 +02:00
Miss Islington (bot) 81de3c2257
bpo-40260: Revert breaking changes made in modulefinder (GH-19595)
(cherry picked from commit 9b0b5d2bae)

Co-authored-by: Barry <barry@barrys-emacs.org>
2020-04-20 08:18:11 -07:00
Miss Islington (bot) 984a567cbb
Fix typo in Lib/tracepack.py (GH-19605)
Typo fix: "emites" -> "emit".
(cherry picked from commit df8913f7c4)

Co-authored-by: Galden <wudenggang0@163.com>
2020-04-19 19:36:03 -07:00
Serhiy Storchaka bfda4db0d2
[3.8] bpo-40179: Fix translation of #elif in Argument Clinic (GH-19364) (GH-19583)
Co-authored-by: Ammar Askar <ammar@ammaraskar.com>
(cherry picked from commit 12446e6a60)
2020-04-18 19:11:48 +03:00
Miss Islington (bot) 904dd068fb
Fix two typos in multiprocessing (GH-19571) (GH-19578)
(cherry picked from commit c606624af8)

Co-authored-by: Galden <wudenggang0@163.com>

Co-authored-by: Galden <wudenggang0@163.com>
2020-04-18 09:24:15 +02:00
Miss Islington (bot) 9796fe88da
bpo-40287: Fix SpooledTemporaryFile.seek() return value (GH-19540)
It has not returned the file position after the seek.
(cherry picked from commit 485e715cb1)

Co-authored-by: Inada Naoki <songofacandy@gmail.com>
2020-04-17 00:14:55 -07:00
Miss Islington (bot) ccf30e96d4
bpo-39793: use the same domain on make_msgid tests (GH-18698) (GH-19554)
(cherry picked from commit 5565c30f0b)

Co-authored-by: Batuhan Taşkaya <batuhanosmantaskaya@gmail.com>
2020-04-16 14:07:52 -04:00
Miss Islington (bot) 3e72de9e08
[3.8] bpo-39667: Sync zipp 3.0 (GH-18540) (GH-18701)
* bpo-39667: Sync zipp 3.0 (GH-18540)

* bpo-39667: Improve pathlib.Path compatibility on zipfile.Path and correct performance degradation as found in zipp 3.0

* 📜🤖 Added by blurb_it.

* Update docs for new zipfile.Path.open

* Rely on dict, faster than OrderedDict.

* Syntax edits on docs

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

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

* Clarify the change in behavior with a couple of workaround options.

* Restore API compatibility while backporting performance improvements.

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
2020-04-15 14:45:25 -04:00
Miss Islington (bot) 59047fab0e
bpo-40260: Update modulefinder to use io.open_code() and respect coding comments (GH-19488)
(cherry picked from commit d42e582063)

Co-authored-by: Barry <barry@barrys-emacs.org>
2020-04-14 12:34:41 -07:00
Miss Islington (bot) 1e1dbdf23f
bpo-32033: Fix test_pwd failures on Android (GH-19502)
(cherry picked from commit 96515e9f67)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2020-04-14 11:31:00 -07:00
Victor Stinner 67b8a1f0f0
[3.8] Update libregrtest from master (GH-19516)
* bpo-37531: regrtest now catchs ProcessLookupError (GH-16827)

Fix a warning on a race condition on TestWorkerProcess.kill(): ignore
silently ProcessLookupError rather than logging an useless warning.

(cherry picked from commit a661392f8f)

* bpo-38502: regrtest uses process groups if available (GH-16829)

test.regrtest now uses process groups in the multiprocessing mode
(-jN command line option) if process groups are available: if
os.setsid() and os.killpg() functions are available.

(cherry picked from commit ecb035cd14)

* bpo-37957: Allow regrtest to receive a file with test (and subtests) to ignore (GH-16989)

When building Python in some uncommon platforms there are some known tests that will fail. Right now, the test suite has the ability to ignore entire tests using the -x option and to receive a filter file using the --matchfile filter. The problem with the --matchfile option is that it receives a file with patterns to accept and when you want to ignore a couple of tests and subtests, is too cumbersome to lists ALL tests that are not the ones that you want to accept and he problem with -x is that is not easy to ignore just a subtests that fail and the whole test needs to be ignored.

For these reasons, add a new option to allow to ignore a list of test and subtests for these situations.

(cherry picked from commit e0cd8aa70a)

* regrtest: log timeout at startup (GH-19514)

Reduce also worker timeout.

(cherry picked from commit 4cf65a630a)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2020-04-14 19:51:18 +02:00
Miss Islington (bot) 61511488cf
bpo-31758: Prevent crashes when using an uninitialized _elementtree.XMLParser object (GH-3997) (GH-19485)
(cherry picked from commit 402e1cdb13)
2020-04-12 17:18:57 +02:00
Serhiy Storchaka ee249d798b
[3.8] bpo-40126: Fix reverting multiple patches in unittest.mock. (GH-19351) (GH-19483)
Patcher's __exit__() is now never called if its __enter__() is failed.
Returning true from __exit__() silences now the exception.
(cherry picked from commit 4b222c9491)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2020-04-12 14:53:46 +03:00
Victor Stinner cd8e1da3ea
bpo-40112: distutils test_search_cpp: Fix logic to determine if C compiler is xlc on AIX (GH-19225) (GH-19444)
(cherry picked from commit 76db37b1d3)

Co-authored-by: Michael Felt <aixtools@users.noreply.github.com>
2020-04-09 17:32:21 +02:00
Miss Islington (bot) c83f003ee5
bpo-40214: Temporarily disable a ctypes test (GH-19404)
Only one particular sub-test of
ctypes.test.test_loading.test_load_dll_with_flags is disabled, which
caused failures on Azure Pipelines CI.
(cherry picked from commit f407e209c1)

Co-authored-by: Zachary Ware <zach@python.org>
2020-04-09 05:31:42 -07:00
Miss Islington (bot) 6318e45bda
bpo-40089: Fix threading._after_fork() (GH-19191) (GH-19194)
If fork was not called by a thread spawned by threading.Thread,
threading._after_fork() now creates a _MainThread instance for
_main_thread, instead of a _DummyThread instance.
(cherry picked from commit d8ff44ce4c)

Co-authored-by: Victor Stinner <vstinner@python.org>
2020-04-07 23:35:52 +02:00
Miss Islington (bot) 8bd84e7f79
bpo-40196: Fix a bug in the symtable when reporting inspecting global variables (GH-19391) (GH-19394)
(cherry picked from commit 799d7d61a9)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2020-04-06 17:41:55 +01:00
Miss Islington (bot) 15337726e5
bpo-38689: avoid IDLE hanging when calltip fails getting a signature (GH-17152)
Inspect.signature failed on the test case because its isinstance call raised.
(cherry picked from commit 52013e5b6d)

Co-authored-by: Tal Einat <taleinat+github@gmail.com>
2020-04-03 20:25:06 -07:00
Victor Stinner 745bd91bab
bpo-40140: test_builtin.PtyTests registers SIGHUP handler (GH-19314) (GH-19316)
test_builtin.PtyTests now registers an handler for SIGHUP signal.
Closing the PTY file descriptor can emit a SIGHUP signal: just ignore
it.

run_child() now also closes the PTY file descriptor before waiting
for the process completition, otherwise the test hangs on AIX.

(cherry picked from commit 7a51a7e19f)
2020-04-03 02:11:54 +02:00
Miss Islington (bot) 1098671e4e
lib2to3: Support named assignment expressions (GH-12702)
There are two copies of the grammar -- the one used by Python itself as
Grammar/Grammar, and the one used by lib2to3 which has necessarily diverged at
Lib/lib2to3/Grammar.txt because it needs to support older syntax an we want it
to be reasonable stable to avoid requiring fixer rewrites.

This brings suport for syntax like `if x:= foo():` to match what the live
Python grammar does.

This should've been added at the time of the walrus operator itself, but lib2to3 being
independent is often overlooked.  So we do consider this a bugfix rather than enhancement.
(cherry picked from commit 3c3aa4516c)

Co-authored-by: Tim Hatch <tim@timhatch.com>
2020-04-02 16:03:09 -07:00
Miss Islington (bot) b7345c24a4
bpo-38972: Link to instructions to change PowerShell execution policy (GH-19131)
(cherry picked from commit 45217af29c)

Co-authored-by: Derek Keeler <d3r3kk@users.noreply.github.com>
2020-04-02 12:19:41 -07:00
Miss Islington (bot) ea9e240aa0
bpo-39503: CVE-2020-8492: Fix AbstractBasicAuthHandler (GH-18284) (GH-19296)
The AbstractBasicAuthHandler class of the urllib.request module uses
an inefficient regular expression which can be exploited by an
attacker to cause a denial of service. Fix the regex to prevent the
catastrophic backtracking. Vulnerability reported by Ben Caller
and Matt Schwager.

AbstractBasicAuthHandler of urllib.request now parses all
WWW-Authenticate HTTP headers and accepts multiple challenges per
header: use the realm of the first Basic challenge.

Co-Authored-By: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>

(cherry picked from commit 0b297d4ff1)
2020-04-02 12:15:55 +02:00
Miss Islington (bot) f971c8c0a0
bpo-40121: Fix exception type in test (GH-19267)
(cherry picked from commit 3ef4a7e5a7)

Co-authored-by: Steve Dower <steve.dower@python.org>
2020-04-01 06:02:55 -07:00
Miss Islington (bot) 6acafee247
Handle when IOCTL_VM_SOCKETS_GET_LOCAL_CID does not exist in "socket" (GH-19270)
Running `test_socket` or anything that depends on it (like python -m
test.pythoninfo) crashes if IOCTL_VM_SOCKETS_GET_LOCAL_CID does not
exist in the socket module.

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

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2020-03-31 18:25:34 -07:00
Miss Islington (bot) 4ced9a7611
bpo-40019: Skip test_gdb if Python was optimized (GH-19081)
test_gdb now skips tests if it detects that gdb failed to read debug
information because the Python binary is optimized.
(cherry picked from commit 7bf069b611)

Co-authored-by: Victor Stinner <vstinner@python.org>
2020-03-31 10:27:41 -07:00
Miss Islington (bot) 6a0ee60db4
bpo-40121: Fixes audit event raised on creating a new socket (GH-19238)
(cherry picked from commit 63ba5cccf4)

Co-authored-by: Steve Dower <steve.dower@python.org>
2020-03-31 04:57:06 -07:00
Miss Islington (bot) 8c3ab189ae
bpo-38002: Use False/True for IDLE pyshell bools (GH-19203)
Change 0/1 assignments to 'executing', 'canceled', 'reading', 'endoffile'.
These are not used outside of pyshell. Other bools already use False/True.
Add comment about int needed for Windows call.
Remove self.more, unused in idlelib and code.InteractiveInterpreter.
The latter uses 'more' as a local.
(cherry picked from commit 34a49aa3e4)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2020-03-28 10:16:03 -07:00
Miss Islington (bot) b05fbe9f37
bpo-1812: Fix newline conversion when doctest.testfile loads from a package whose loader has a get_data method (GH-17385)
This pull request fixes the newline conversion bug originally reported in bpo-1812. When that issue was originally submitted, the open builtin did not default to universal newline mode; now it does, which makes the issue fix simpler, since the only code path that needs to be changed is the one in doctest._load_testfile where the file is loaded from a package whose loader has a get_data method.
(cherry picked from commit e0b8101492)

Co-authored-by: Peter Donis <peterdonis@alum.mit.edu>
2020-03-26 09:18:52 -07:00
Miss Islington (bot) 686d508c26
bpo-40016: re docstring: Clarify relationship of inline and argument flags (GH-19078)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
(cherry picked from commit 89a2209ae6)

Co-authored-by: Ram Rachum <ram@rachum.com>
2020-03-25 12:01:31 -07:00
Miss Islington (bot) c959fa9353
bpo-22490: Remove __PYVENV_LAUNCHER__ from environment during launch (GH-9516) (GH-19110)
* bpo-22490: Remove "__PYVENV_LAUNCHER__" from the shell environment on macOS

This changeset removes the environment varialbe "__PYVENV_LAUNCHER__"
during interpreter launch as it is only needed to communicate between
the stub executable in framework installs and the actual interpreter.

Leaving the environment variable present may lead to misbehaviour when
launching other scripts.

* Actually commit the changes for issue 22490...

* Correct typo

Co-Authored-By: Nicola Soranzo <nicola.soranzo@gmail.com>

* Run make patchcheck

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
Co-authored-by: Nicola Soranzo <nicola.soranzo@gmail.com>
(cherry picked from commit 044cf94f61)

Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>

Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
2020-03-22 14:56:26 -04:00
Miss Islington (bot) 687f5921a4
bpo-39652: Truncate the column name after '[' only if PARSE_COLNAMES is set. (GH-18942)
(cherry picked from commit b146568dfc)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2020-03-21 07:32:25 -07:00
Victor Stinner ba26bf3094
[3.8] bpo-27807: Skip test_site.test_startup_imports() if pth file (GH-19060) (GH-19090)
test_site.test_startup_imports() is now skipped if a path of sys.path
contains a .pth file.

Sort test_site imports.
2020-03-20 15:10:14 +01:00
Miss Islington (bot) ec8a973f7c
bpo-39562: Allow executing asynchronous comprehensions in the asyncio REPL (GH-18968)
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
(cherry picked from commit 9052f7a41b)

Co-authored-by: Batuhan Taşkaya <47358913+isidentical@users.noreply.github.com>
2020-03-19 04:54:16 -07:00
Miss Islington (bot) 7f5302fed4
bpo-39360: Ensure all workers exit when finalizing a multiprocessing Pool (GH-19009)
When the pull is not used via the context manager or terminate() is called, there is a system in multiprocessing.util that handles finalization of all pools via an atexit handler (the Finalize) class. This class registers the _terminate_pool handler in the registry of finalizers of the module, and that registry is called on interpreter exit via _exit_function. The problem is that the "happy" path with the context manager or manual call to finalize() does some extra steps that _terminate_pool does not. The step that is not executed when the atexit() handler calls _terminate_pool is pinging the _change_notifier queue to unblock the maintenance threads.

This commit moves the notification to the _terminate_pool function so is called from both code paths.

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
(cherry picked from commit ac10e0c932)

Co-authored-by: Batuhan Taşkaya <47358913+isidentical@users.noreply.github.com>
2020-03-15 14:26:43 -07:00
Miss Islington (bot) f7e32fcbd6
bpo-39965: Correctly raise SyntaxError if await is used outside async functions when PyCF_ALLOW_TOP_LEVEL_AWAIT is set (GH-19010)
(cherry picked from commit 90235810ec)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2020-03-14 21:46:26 -07:00
Miss Islington (bot) ff69c9d12c
bpo-38576: Disallow control characters in hostnames in http.client (GH-18995)
Add host validation for control characters for more CVE-2019-18348 protection.
(cherry picked from commit 9165addc22)

Co-authored-by: Ashwin Ramaswami <aramaswamis@gmail.com>
2020-03-14 12:13:32 -07:00
Mark Dickinson e634a8ac1f
[3.8] bpo-39871: Fix possible SystemError in atan2, copysign and remainder (GH-18806) (GH-18989)
In math_2(), the first PyFloat_AsDouble() call should be checked
for failure before the second call.

Co-authored-by: Mark Dickinson <dickinsm@gmail.com>.
(cherry picked from commit 5208b4b379)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2020-03-14 11:38:52 +00:00
Miss Islington (bot) f6bdac1bf7
bpo-39915: Ensure await_args_list is updated according to the order in which coroutines were awaited (GH-18927)
Create call objects with awaited arguments instead of using call_args which has only last call value.
(cherry picked from commit e553f204bf)

Co-authored-by: Karthikeyan Singaravelan <tir.karthi@gmail.com>
2020-03-14 07:12:57 +00:00
Miss Islington (bot) f8ce3e2dae
bpo-39689: Do not test undefined casts to _Bool (GH-18964) (#18966)
- When casting to _Bool, arrays should only contain zeros or ones.
(cherry picked from commit 1ae9cde4b2)

Co-authored-by: Stefan Krah <skrah@bytereef.org>
2020-03-12 19:56:18 +01:00
Serhiy Storchaka ab9c729121
[3.8] bpo-38643: Raise SystemError instead of crashing when PyNumber_ToBase is called with invalid base. (GH-18863). (GH-18954)
(cherry picked from commit e5ccc94bbb)
2020-03-12 09:30:56 +02:00
Miss Islington (bot) 99ef1ac9a7
Fix syntax error in an example in the ast documentation and sync docstrings (GH-18946)
(cherry picked from commit c00c86b904)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2020-03-11 18:06:53 -07:00
Miss Islington (bot) cd07b4da65
bpo-39520: Fix un-parsing of ext slices with no dimensions (GH-18304)
(cherry picked from commit 185903de12)

Co-authored-by: Batuhan Taşkaya <47358913+isidentical@users.noreply.github.com>
2020-03-11 13:18:01 -07:00
Miss Islington (bot) c22879914b
bpo-39916: Use os.scandir() as context manager in Path.glob(). (GH-18880)
(cherry picked from commit 704e2065f8)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2020-03-11 10:07:04 -07:00
Miss Islington (bot) 212acf544a
bpo-38662: ensurepip invokes pip via runpy (GH-18901)
The ensurepip module now invokes pip via the runpy module.
Hence it is no longer tightly coupled with the internal API of the bundled
pip version, allowing easier updates to a newer pip version both
internally and for distributors.

This way, any changes to the internal pip API won't mean ensurepip needs to be
changed as well. Also, distributors can update their pip wheels independent on
CPython release schedule.

Co-Authored-By: Pradyun Gedam <pradyunsg@gmail.com>
Co-Authored-By: Miro Hrončok <miro@hroncok.cz>
(cherry picked from commit 88f82b2b9e)

Co-authored-by: Miro Hrončok <miro@hroncok.cz>
2020-03-10 14:37:50 -07:00
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