Commit Graph

107473 Commits

Author SHA1 Message Date
Victor Stinner b1e7361134
bpo-38377: Add support.skip_if_broken_multiprocessing_synchronize() (GH-20944) (GH-20962)
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)
2020-06-18 17:19:59 +02:00
Inada Naoki 610a60c601
bpo-36346: Add Py_DEPRECATED to deprecated unicode APIs (GH-20878)
Co-authored-by: Kyle Stanley <aeros167@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
(cherry picked from commit 2c4928d37e)
2020-06-18 17:30:53 +09:00
stratakis 9a58f03dc2
[3.9] bpo-40637: Do not emit warnings for disabled builtin hashes (GH… (GH-20951)
…-20937)

test_hashlib emits some warnings when it cannot find some hashes
as it assumes they failed to compile. Since we can disable hashes
through configure, we emit the warnings only in the case that we
did not intentionaly disable them.

Automerge-Triggered-By: @tiran
(cherry picked from commit 236a0f5)

Co-authored-by: stratakis <cstratak@redhat.com>
2020-06-17 12:43:27 -07:00
Victor Stinner b39d41ba1b
bpo-41003: Fix test_copyreg when numpy is installed (GH-20935) (GH-20945)
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)
2020-06-17 18:40:14 +02:00
Miss Islington (bot) 2c6d6c12c2
bpo-19569: Add a macro to suppress deprecation warnings (GH-9004)
Co-authored-by: Arfrever Frehtes Taifersar Arahesis <arfrever.fta@gmail.com>
(cherry picked from commit de4304dad8)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2020-06-16 20:18:02 -07:00
Miss Islington (bot) 7795ae8f05
bpo-40958: Avoid buffer overflow in the parser when indexing the current line (GH-20875) (GH-20919)
(cherry picked from commit 51c5896b62)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2020-06-16 18:36:59 +01:00
Miss Islington (bot) 3cf809475a
bpo-40993: Don't run Travis CI coverage on PRs (GH-20916)
C and Python coverage jobs of Travis CI are no longer run on pull
requests, only on branches like master.
(cherry picked from commit fc710ee266)

Co-authored-by: Victor Stinner <vstinner@python.org>
2020-06-16 08:47:16 -07:00
Miss Islington (bot) 097b8b6d52
bpo-40985: Show correct SyntaxError text when last line has a LINECONT (GH-20888)
When a file ends with a line that contains a line continuation character
the text of the emitted SyntaxError is empty, contrary to the old
parser, where the error text contained the text of the last line.
(cherry picked from commit 113e2b0a07)

Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
2020-06-15 17:46:44 -07:00
Miss Islington (bot) bc996c67b7
bpo-38488: Upgrade bundled versions of pip & setuptools (GH-20491)
(cherry picked from commit 5f79f46612)

Co-authored-by: Xavier Fernandez <xav.fernandez@gmail.com>
2020-06-15 13:39:49 -07:00
Miss Islington (bot) b498c7f1b3
bpo-36020: Remove snprintf macro in pyerrors.h (GH-20889)
On Windows, GH-include "pyerrors.h" no longer defines "snprintf" and
"vsnprintf" macros.

PyOS_snprintf() and PyOS_vsnprintf() should be used to get portable
behavior.

Replace snprintf() calls with PyOS_snprintf() and replace vsnprintf()
calls with PyOS_vsnprintf().
(cherry picked from commit e822e37946)

Co-authored-by: Victor Stinner <vstinner@python.org>
2020-06-15 13:20:10 -07:00
Miss Islington (bot) 9a0624a3d9
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:48:44 -07:00
Miss Islington (bot) 2ad799fc76
bpo-37556 Extend help to include latest overrides (GH-14701)
Modify the help in cpython/PC/launcher.c to show users that "latest" can be overridden by shebang, PY_PYTHON[n] or py.ini files. Also show that script [args] is optional by enclosing in square brackets.

Automerge-Triggered-By: @zooba
(cherry picked from commit b3e6783423)

Co-authored-by: Steve (Gadget) Barnes <gadgetsteve@live.co.uk>
2020-06-15 09:56:40 -07:00
Miss Islington (bot) b87453f94f
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:30 -07:00
Miss Islington (bot) bab0833d49
bpo-40910: PyConfig_Clear() clears _orig_argv (GH-20886)
bpo-40910, bpo-40953: PyConfig_Clear() clears _orig_argv.
(cherry picked from commit e2d47a0568)

Co-authored-by: Victor Stinner <vstinner@python.org>
2020-06-15 08:19:06 -07:00
Pablo Galindo 30b59fd7cf
[3.9] Improve readability and style in parser files (GH-20884) (GH-20885)
(cherry picked from commit fb61c42)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2020-06-15 15:08:00 +01:00
Pablo Galindo 145fa86598
[3.9] Include soft keywords in keyword.py (GH-20877). (GH-20880)
(cherry picked from commit 78319e373d)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2020-06-15 04:31:05 +01:00
Jason R. Coombs 8a3469047c
[3.9] bpo-40924: Remove protocol for supplying Traversable objects from loaders (GH-20820)
Remove protocol that loaders can present a files method as found in importlib_resources 1.3-1.6 (added in Python 3.8b1).
2020-06-14 14:12:20 +02:00
Miss Islington (bot) 83cd968f5c
bpo-30064: Fix slow asyncio sock test (GH-20868)
Using a log2n way to fill a much smaller buffer, and receiving in a cleaner way with EOF.

The failing test was reproducible using the following command thanks to @aeros :

```bash
./python -m test test_asyncio.test_sock_lowlevel --match test_sock_client_racing -j100 -F -v
```

According to test results, we may still need to bump the timeout:

5aad027db9/Lib/test/test_asyncio/test_sock_lowlevel.pyGH-L256-L257
(cherry picked from commit 8f04a84755)

Co-authored-by: Fantix King <fantix.king@gmail.com>
2020-06-14 01:08:08 -07:00
Miss Islington (bot) 37c9fc5baa
Some reformatting (suggested by Black) and minor factoring. (GH-20865) (GH-20866) 2020-06-13 19:53:32 -07:00
Miss Islington (bot) 55c1d21761
bpo-40855: Fix ignored mu and xbar parameters (GH-20835) (#GH-20862) 2020-06-13 16:56:15 -07:00
Miss Islington (bot) bda4cc82de
[3.9] bpo-37674: Tweak imp module deprecation note in the docs (GH-20480) (GH-20859)
(cherry picked from commit dea3223740)


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

Automerge-Triggered-By: @brettcannon
2020-06-13 13:55:38 -07:00
Miss Islington (bot) f1534d0840
Minor code clean-ups (GH-20838) (GH-20858) 2020-06-13 10:23:48 -07:00
Miss Islington (bot) c932f5c1e5
bpo-40957: Fix refleak in _Py_fopen_obj() (GH-20827)
Signed-off-by: Christian Heimes <christian@python.org>
(cherry picked from commit 9672912e8f)

Co-authored-by: Christian Heimes <christian@python.org>
2020-06-13 09:18:52 -07:00
Miss Islington (bot) 94bb4b7db2
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:38 -07:00
Miss Islington (bot) 166d7234b5
bpo-40164: Update Windows OpenSSL to 1.1.1g (GH-20834)
(cherry picked from commit 80d827c3cb)

Co-authored-by: Srinivas Reddy Thatiparthy (శ్రీనివాస్  రెడ్డి తాటిపర్తి) <thatiparthysreenivas@gmail.com>
2020-06-12 14:06:52 -07:00
Christian Heimes f919179087
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:06:20 -04:00
Miss Islington (bot) ee3f7fee94
bpo-40955: Fix memory leak in subprocess module (GH-20825)
```
Direct leak of 8 byte(s) in 1 object(s) allocated from:
    GH-0 0x7f008bf19667 in __interceptor_malloc (/lib64/libasan.so.6+0xb0667)
    GH-1 0x7f007a0bee4a in subprocess_fork_exec /home/heimes/dev/python/cpython/Modules/_posixsubprocess.c:774
    GH-2 0xe0305b in cfunction_call Objects/methodobject.c:546
```

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

Co-authored-by: Christian Heimes <christian@python.org>
2020-06-12 10:02:45 -07:00
Miss Islington (bot) 2c0a59bb3d
Update lexical_analysis.rst (GH-17508)
Use Sphinx role markup for `str.format`.

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

Co-authored-by: Géry Ogam <gery.ogam@gmail.com>
2020-06-12 06:01:20 -07:00
Pablo Galindo 3782497cc2
[3.9] bpo-40939: Fix test_keyword for the old parser (GH-20814) 2020-06-11 19:29:13 +01:00
Victor Stinner dc40105c88
bpo-40947: getpath.c uses PyConfig.platlibdir (GH-20807) (GH-20813)
Followup of bpo-40854, there is one remaining usage of PLATLIBDIR
which should be replaced by config->platlibdir.

test_sys checks that sys.platlibdir attribute exists and is a string.

Update Makefile: getpath.c and sysmodule.c no longer need PLATLIBDIR
macro, PyConfig.platlibdir member is used instead.

Co-authored-by: Sandro Mani <manisandro@gmail.com>
(cherry picked from commit d72b9644a3)
2020-06-11 18:27:00 +02:00
Miss Islington (bot) 2f46c65071
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:08:29 -07:00
Miss Islington (bot) 961edf7979
bpo-40939: Generate keyword.py using the new parser (GH-20800)
(cherry picked from commit 9727694f08)

Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
2020-06-11 06:02:37 -07:00
Miss Islington (bot) f6428babb1
Collections module reformatting and minor code refactoring (GH-20772) (GH-20798) 2020-06-11 00:08:27 -07:00
Miss Islington (bot) e3ce3bba92
bpo-40847: Consider a line with only a LINECONT a blank line (GH-20769)
A line with only a line continuation character should be considered
a blank line at tokenizer level so that only a single NEWLINE token
gets emitted. The old parser was working around the issue, but the
new parser threw a `SyntaxError` for valid input. For example,
an empty line following a line continuation character was interpreted
as a `SyntaxError`.

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

Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
2020-06-10 17:14:16 -07:00
Miss Islington (bot) 18e07ba931
bpo-40895: Update weakref documentation to remove old warnings (GH-20687)
The doccumentation at https://docs.python.org/3.10/library/weakref.html cautions that the `WeakKeyDictionary` and `WeakValueDictionary` are susceptible to the problem of dictionary mutation during iteration.

These notes present the user with a problem that has no easy solution.

I dug into the implementation and found that fortunately, Antoine Pitrou already addressed this challenge (10 years ago!) by introducing an `_IterationGuard` context manager to the implementation, which delays mutation while an iteration is in progress.

I asked for confirmation and @pitrou agreed that these notes could be removed:
c1baa601e2GH-commitcomment-39514438
(cherry picked from commit 1642c0ef75)

Co-authored-by: Daniel Fortunov <asqui@users.noreply.github.com>
2020-06-10 13:33:59 -07:00
Victor Stinner af69325753
bpo-40927: Fix test_binhex when run twice (GH-20764) (GH-20789)
test_binhex now uses import_fresh_module() to ensure that it raises
DeprecationWarning each time.

(cherry picked from commit 9c24e2e4c1)
2020-06-10 20:17:13 +02:00
Victor Stinner 4a4f660cfd
bpo-40826: Fix test_repl.test_close_stdin() on Windows (GH-20779) (GH-20785)
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)
2020-06-10 19:24:56 +02:00
Miss Islington (bot) 9419158a3e
bpo-40703: Let PyType_FromSpec() set "type.__module__" only if it is not set yet. (GH-20273) (GH-20782)
(cherry picked from commit 24b8bad6d3)
2020-06-10 18:43:10 +02:00
Miss Islington (bot) 3b97d1becb
bpo-36543: Revert "bpo-36543: Remove the xml.etree.cElementTree module." (GH-20117) (GH-20780)
* Revert "bpo-36543: Remove the xml.etree.cElementTree module. (GH-19108)"

This reverts commit b33e52511a.
(cherry picked from commit ec88e1bca8)
2020-06-10 18:01:25 +02:00
Miss Islington (bot) d55ed7b107
Raise specialised syntax error for invalid lambda parameters (GH-20776)
(cherry picked from commit c6483c9896)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2020-06-10 06:24:41 -07:00
Miss Islington (bot) 73b728a779
[3.9] bpo-34003: Re-add versionchanged entry in csv docs (GH-20657) (GH-20770)
Follow-up to GH-8014
(cherry picked from commit 7aed0524d4)


Co-authored-by: Éric Araujo <merwok@netwok.org>

Automerge-Triggered-By: @merwok
2020-06-09 18:26:36 -07:00
Łukasz Langa 6c645cbdd2
Post 3.9.0b3 2020-06-09 23:35:14 +02:00
Łukasz Langa b484871ba7
Python 3.9.0b3 2020-06-09 20:52:10 +02:00
Łukasz Langa ce5e6f098f
[3.9] bpo-40924: Revert "bpo-39791 native hooks for importlib.resources.files (GH-20576)" (#20760)
This reverts commit 9cf1be46e3 due to
https://bugs.python.org/issue40924.
2020-06-09 19:50:01 +02:00
Miss Islington (bot) 6cb24a035c
bpo-40684: Fix make install for platlibdir=lib64 (GH-20736)
"make install" now uses the PLATLIBDIR variable for the destination
lib-dynload/ directory when ./configure --with-platlibdir is used.

Update --with-platlibdir comment in configure.
(cherry picked from commit 51ae31e5b9)

Co-authored-by: Victor Stinner <vstinner@python.org>
2020-06-09 06:54:54 -07:00
Miss Islington (bot) 1a819ca187
Remove reference to 3.7 and 3.8 backports. (GH-20754) (#20755)
(cherry picked from commit 323188360d)

Authored-by: Stefan Krah <skrah@bytereef.org>
2020-06-09 10:35:58 +02:00
Łukasz Langa 459cb12a29
Post 3.9.0b2 2020-06-09 02:23:35 +02:00
Łukasz Langa 8f1f4161de Python 3.9.0b2
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEE4/8oOcBIslwITevpsmmV4xAlBWgFAl7etVEACgkQsmmV4xAl
 BWjzUxAAmbCfQsA5KW2o8fyj4R3NOI69juBUHaUmcHp668Ah8wbVjz7cf+uGOJ/1
 TLVMUez3I27BhPRNhjfawH6Xv/xpnAWbCzK7GNpspSlUkY0OXk30We5ddbuz2p8I
 4yff9aHAH1pgkdSz7W51aJrgNfzOhyFL7affDuQraKpUNLJdDXjRjSVGdXRHXXk5
 ft7hTgxDVRL0DNJFFl9DKXlpQ7S6GywfaAEPJj22Gu1nKQRQGx8pa+Z3HtKOtTGq
 x3AoTNQdvaZXxqIfp67gG7S4DMrmMxCT/Sv+IsqoBVTEVKfaH6uGMtxUQJSWhngf
 yY1uARSxYwhbXsEtD2wRWmn+lOLq8HHdnDOg9X1564s/unaPoelebhy3RCA9qChh
 65O+wKZ/zzJQQc7Gee3uEQnK//51ihqgM0YEEKG3DPHRyFFdFIE92XQ/sQuxkTcc
 wPH2+edUhoGNND+oFWV7uPLlpqAsp6de+Cs3TXRpjjFFhNDOm15WgStdHvrIhvob
 67ri9PO4tS94zVY1a3bn0Z/uwMerz22zZSU15Ov+8Sezb00LRqiNntRXdzTcD3cB
 XxnMliiytbH/Ft6WXb3W77usdXnXR3SDLwnizjgLPkzOFWTcfeggQmblmFtN5/Mi
 1PxlMAo6usF75d7ZKsV4jAAG5H1PXUk5+DcFiQoNvuLI7OxNbIs=
 =sDBi
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQJEBAABCAAuFiEE4/8oOcBIslwITevpsmmV4xAlBWgFAl7e1n0QHGx1a2FzekBs
 YW5nYS5wbAAKCRCyaZXjECUFaEFGEACTv9oYX+gMEPCdJIdJyNWBFRA+QRxIcpwQ
 /PZbTpx/SIlrSzSYGw1q5w42gl9fIXXWpnhlFmY/Y2LbNPz7fK4OAigvUCzcvc9Q
 6q3dOyR4CfZu7c0u+zlzjKL9oGcadw99Bk/LYTa0zcLLadTemzeVRZnM3VCd17os
 E61JgJtUrXpyjfaStuMoYjYjbW4aH7mnRIAgH2ugqkbI+RbO0HAxYVdI56WxYe0x
 Qt5gqqYoJs3pZSGphnpkQqRcngfueefwMDCzl74s5zLt25MIuHacdFhLExuW5o44
 IRAnWJ8BotY8Y+SY6W/lz7ZCpS4mGhAo8dFRZSLrVS2UHQBvvgvijaDbUjmNyHPP
 /SNGpjoYvBE5k9qzXNpRrIL3DuqaCYexEpGemOp3RTTx4kayACRomAe3kBYve5jE
 Bt/9GqpZbORsnhjdL3CWRhDtBTg3TH2e3ea1ccliFyUjaSy2BgkqtS0FKnv7lNpB
 uQwPyEIjDkz3+yXFik1Eaew9L/63oqi7RIh6cTAh/0By3r4f3aEHqdSVsJFrfzmU
 eOCINcMPtrMd4zwelzrboPTnb79EpfBYCATOUPOe82KOwNafWOqvZn8hXeVvlgiS
 gmDh5sv1Q7QDiCZSYklka7IcHT5Dj+i4BrOYXACIvOvyOZBBNMwslr6vTxzKkt3q
 FqNsF5Jwhw==
 =X0Xv
 -----END PGP SIGNATURE-----

Merge tag 'v3.9.0b2' into 3.9

Python 3.9.0b2
2020-06-09 02:23:22 +02:00
Miss Islington (bot) 299d3d1c52
Minor improvement to the namedtuple implementation (GH-20741) (GH-20742) 2020-06-08 13:25:48 -07:00
Miss Islington (bot) b155381314
bpo-24914: mention Python supports multiple paradigms in the FAQ (GH-20658) (GH-20737)
(cherry picked from commit 3ab3475c42)

Co-authored-by: Brett Cannon <brett@python.org>

Co-authored-by: Brett Cannon <brett@python.org>
2020-06-08 11:53:36 -07:00