summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* [3.9] Do not emit deprecation warnings inside CPython for old parser APIs ↵Pablo Galindo2020-06-211-7/+15
| | | | (GH-21025)
* bpo-41058: Use source file encoding in pdb.find_function(). (GH-21010)Miss Islington (bot)2020-06-213-14/+42
| | | | | (cherry picked from commit 19fcffa92773e008e4f5efb80047420a0cfafeec) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* bpo-41056: Fix a NULL pointer dereference on MemoryError within the ssl ↵Miss Islington (bot)2020-06-212-6/+7
| | | | | | | | module. (GH-21009) Detected by Coverity. (cherry picked from commit eb0d5c38de7f970d8cd8524f4163d831c7720f51) Co-authored-by: Gregory P. Smith <greg@krypto.org>
* [3.9] bpo-41052: Opt out serialization/deserialization for _random.Random ↵Dong-hee Na2020-06-214-1/+47
| | | | | | | (GH-21002). (GH-21030) (cherry picked from commit 6989af0bc7ea1e9a1acea16794e6f723d7b44110) Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
* [3.9] bpo-41060: Avoid SEGFAULT when calling GET_INVALID_TARGET in the ↵Lysandros Nikolaou2020-06-214-26/+38
| | | | | | | | | | | | | grammar (GH-21020) (GH-21024) `GET_INVALID_TARGET` might unexpectedly return `NULL`, which if not caught will cause a SEGFAULT. Therefore, this commit introduces a new inline function `RAISE_SYNTAX_ERROR_INVALID_TARGET` that always checks for `GET_INVALID_TARGET` returning NULL and can be used in the grammar, replacing the long C ternary operation used till now. (cherry picked from commit 6c4e0bd974f2895d42b63d9d004587e74b286c88) Automerge-Triggered-By: @pablogsal
* [3.9] bpo-40939: Deprecate the PyParser_SimpleParse* functions (GH-21012)Lysandros Nikolaou2020-06-214-8/+23
|
* Add link to .pypirc specification (GH-20680)Miss Islington (bot)2020-06-201-0/+3
| | | | | | | | Related to https://github.com/pypa/twine/issues/638 and https://github.com/pypa/packaging.python.org/issues/730, I wrote a spec based on the one that was removed in https://github.com/python/cpython/pull/13087. However, a Google search for "pypirc" turned up at least one [blog post](https://truveris.github.io/articles/configuring-pypirc/) that links to https://docs.python.org/3/distutils/packageindex.htmlGH-the-pypirc-file, which now just links to this document. So, I thought a link to the spec would be handy. Automerge-Triggered-By: @jaraco (cherry picked from commit af157fad286c00ff204e86d8556648cbb53ba99e) Co-authored-by: Brian Rutledge <brian@bhrutledge.com>
* bpo-41044: Generate valid PEG python parsers for opt+seq rules (GH-20995)Miss Islington (bot)2020-06-202-1/+15
| | | | | | Co-authored-by: Pablo Galindo <Pablogsal@gmail.com> (cherry picked from commit 55460ee6dc9a4f16bd68d6b6be3a8398c7d4a596) Co-authored-by: Batuhan Taskaya <isidentical@gmail.com>
* bpo-40958: Avoid 'possible loss of data' warning on Windows (GH-20970)Miss Islington (bot)2020-06-202-2/+2
| | | | | (cherry picked from commit 861efc6e8fe7f030b1e193989b13287b31385939) Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
* bpo-41040: Fix test_modulefinder. (GH-20991)Miss Islington (bot)2020-06-191-1/+2
| | | | | (cherry picked from commit a041e116db5f1e78222cbf2c22aae96457372680) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* bpo-38377: Fix skip_if_broken_multiprocessing_synchronize() on macOS (GH-20984)Miss Islington (bot)2020-06-191-8/+9
| | | | | | | | 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 3358da4054b9b0b045eb47dc74dee3d58bfbb1d5) Co-authored-by: Victor Stinner <vstinner@python.org>
* Improve readability of `formataddr` docstring (GH-20963)Miss Islington (bot)2020-06-191-1/+1
| | | | | | | | | | 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 66a65ba43cb3e68a43e32469c988dd7a6cff049c) Co-authored-by: Jürgen Gmach <juergen.gmach@googlemail.com>
* [3.9] bpo-40334: Produce better error messages on invalid targets (GH-20106) ↵Lysandros Nikolaou2020-06-196-1456/+1847
| | | | | | | | | | | | | | | | | | | (GH-20973) * bpo-40334: Produce better error messages on invalid targets (GH-20106) The following error messages get produced: - `cannot delete ...` for invalid `del` targets - `... is an illegal 'for' target` for invalid targets in for statements - `... is an illegal 'with' target` for invalid targets in with statements Additionally, a few `cut`s were added in various places before the invocation of the `invalid_*` rule, in order to speed things up. Co-authored-by: Pablo Galindo <Pablogsal@gmail.com> (cherry picked from commit 01ece63d42b830df106948db0aefa6c1ba24416a)
* bpo-38377: Add support.skip_if_broken_multiprocessing_synchronize() ↵Victor Stinner2020-06-188-12/+41
| | | | | | | | | | (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 ddbeb2f3e02a510c5784ffd74c5e09e8c70b5881)
* bpo-36346: Add Py_DEPRECATED to deprecated unicode APIs (GH-20878)Inada Naoki2020-06-186-22/+75
| | | | | Co-authored-by: Kyle Stanley <aeros167@gmail.com> Co-authored-by: Victor Stinner <vstinner@python.org> (cherry picked from commit 2c4928d37edc5e4aeec3c0b79fa3460b1ec9b60d)
* [3.9] bpo-40637: Do not emit warnings for disabled builtin hashes (GH… ↵stratakis2020-06-171-1/+1
| | | | | | | | | | | | | | | (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>
* bpo-41003: Fix test_copyreg when numpy is installed (GH-20935) (GH-20945)Victor Stinner2020-06-174-13/+29
| | | | | | | | | | 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 8362893e3fe083df2ec8bb94c28b1a78383eadbf)
* bpo-19569: Add a macro to suppress deprecation warnings (GH-9004)Miss Islington (bot)2020-06-172-0/+22
| | | | | | Co-authored-by: Arfrever Frehtes Taifersar Arahesis <arfrever.fta@gmail.com> (cherry picked from commit de4304dad8e035dbbb57d653e685312eead816df) Co-authored-by: Zackery Spytz <zspytz@gmail.com>
* bpo-40958: Avoid buffer overflow in the parser when indexing the current ↵Miss Islington (bot)2020-06-164-16/+16
| | | | | | | line (GH-20875) (GH-20919) (cherry picked from commit 51c5896b6205911d29ac07f167ec7f3cf1cb600d) Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
* bpo-40993: Don't run Travis CI coverage on PRs (GH-20916)Miss Islington (bot)2020-06-161-0/+12
| | | | | | | C and Python coverage jobs of Travis CI are no longer run on pull requests, only on branches like master. (cherry picked from commit fc710ee266e9461fdba9933ec6004318db588820) Co-authored-by: Victor Stinner <vstinner@python.org>
* bpo-40985: Show correct SyntaxError text when last line has a LINECONT ↵Miss Islington (bot)2020-06-163-4/+13
| | | | | | | | | | (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 113e2b0a07c72c0d5e3489076afb14f6b3ad1049) Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
* bpo-38488: Upgrade bundled versions of pip & setuptools (GH-20491)Miss Islington (bot)2020-06-156-7/+8
| | | | | (cherry picked from commit 5f79f46612c351bde78a41c5264c42db21008868) Co-authored-by: Xavier Fernandez <xav.fernandez@gmail.com>
* bpo-36020: Remove snprintf macro in pyerrors.h (GH-20889)Miss Islington (bot)2020-06-156-31/+26
| | | | | | | | | | | | | 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 e822e37946f27c09953bb5733acf3b07c2db690f) Co-authored-by: Victor Stinner <vstinner@python.org>
* bpo-40448: ensurepip: Do not use cache (GH-19812)Miss Islington (bot)2020-06-154-9/+12
| | | | | | | | | | | | | | | | | 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 4a3a682b12f93a03888e8b59f439bc5fe30d6055) Co-authored-by: Krzysztof Konopko <kkonopko@users.noreply.github.com>
* bpo-37556 Extend help to include latest overrides (GH-14701)Miss Islington (bot)2020-06-152-1/+11
| | | | | | | | 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 b3e6783423f58597419abae343dd1d5dcc02a7e3) Co-authored-by: Steve (Gadget) Barnes <gadgetsteve@live.co.uk>
* bpo-34226: fix cgi.parse_multipart without content_length (GH-8530)Miss Islington (bot)2020-06-153-2/+21
| | | | | | | | | | | | 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 d8cf3514dd4682419a66f6e834bb384ee34afc95) Co-authored-by: roger <rogerduran@gmail.com>
* bpo-40910: PyConfig_Clear() clears _orig_argv (GH-20886)Miss Islington (bot)2020-06-151-0/+2
| | | | | | bpo-40910, bpo-40953: PyConfig_Clear() clears _orig_argv. (cherry picked from commit e2d47a0568c6da9229580829917fd6aa702133b3) Co-authored-by: Victor Stinner <vstinner@python.org>
* [3.9] Improve readability and style in parser files (GH-20884) (GH-20885)Pablo Galindo2020-06-152-119/+160
| | | | | (cherry picked from commit fb61c42) Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
* [3.9] Include soft keywords in keyword.py (GH-20877). (GH-20880)Pablo Galindo2020-06-153-8/+20
| | | | | (cherry picked from commit 78319e373d57cd4da67660f888aa7092efbd6f24) Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
* [3.9] bpo-40924: Remove protocol for supplying Traversable objects from ↵Jason R. Coombs2020-06-143-14/+2
| | | | | 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).
* bpo-30064: Fix slow asyncio sock test (GH-20868)Miss Islington (bot)2020-06-141-14/+20
| | | | | | | | | | | | | | | | 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: https://github.com/python/cpython/blob/5aad027db9618f22f6fa2274e05dd50f928d2ed7/Lib/test/test_asyncio/test_sock_lowlevel.pyGH-L256-L257 (cherry picked from commit 8f04a84755babe516ebb5304904ea7c15b865c80) Co-authored-by: Fantix King <fantix.king@gmail.com>
* Some reformatting (suggested by Black) and minor factoring. (GH-20865) ↵Miss Islington (bot)2020-06-141-31/+29
| | | | (GH-20866)
* bpo-40855: Fix ignored mu and xbar parameters (GH-20835) (#GH-20862)Miss Islington (bot)2020-06-133-2/+18
|
* [3.9] bpo-37674: Tweak imp module deprecation note in the docs (GH-20480) ↵Miss Islington (bot)2020-06-131-1/+1
| | | | | | | | | | (GH-20859) (cherry picked from commit dea3223740127ac13f984c1d38f127ab6701af44) Co-authored-by: Zackery Spytz <zspytz@gmail.com> Automerge-Triggered-By: @brettcannon
* Minor code clean-ups (GH-20838) (GH-20858)Miss Islington (bot)2020-06-131-89/+110
|
* bpo-40957: Fix refleak in _Py_fopen_obj() (GH-20827)Miss Islington (bot)2020-06-132-0/+2
| | | | | | Signed-off-by: Christian Heimes <christian@python.org> (cherry picked from commit 9672912e8f90374fd31b37ca0fb7cefbc6f4c555) Co-authored-by: Christian Heimes <christian@python.org>
* bpo-40834: Fix truncate when sending str object with channel (GH-20555)Miss Islington (bot)2020-06-133-1/+5
| | | | | (cherry picked from commit 29c117202e386bad1d66ae336e2fefa1a1809ee0) Co-authored-by: An Long <aisk@users.noreply.github.com>
* bpo-40164: Update Windows OpenSSL to 1.1.1g (GH-20834)Miss Islington (bot)2020-06-125-8/+9
| | | | | (cherry picked from commit 80d827c3cb041ae72b9b0572981c50bdd1fe2cab) Co-authored-by: Srinivas Reddy Thatiparthy (శ్రీనివాస్ రెడ్డి తాటిపర్తి) <thatiparthysreenivas@gmail.com>
* bpo-40964: disable remote IMAP tests (GH-20836)Christian Heimes2020-06-122-0/+5
| | | | | | 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>
* bpo-40955: Fix memory leak in subprocess module (GH-20825)Miss Islington (bot)2020-06-122-0/+2
| | | | | | | | | | | | | ``` 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 0d3350daa8123a3e16d4a534b6e873eb12c10d7c) Co-authored-by: Christian Heimes <christian@python.org>
* Update lexical_analysis.rst (GH-17508)Miss Islington (bot)2020-06-121-1/+1
| | | | | | | | Use Sphinx role markup for `str.format`. Automerge-Triggered-By: @csabella (cherry picked from commit e2fb8a2c42ee60c72a40d93da69e9efc4e359023) Co-authored-by: Géry Ogam <gery.ogam@gmail.com>
* [3.9] bpo-40939: Fix test_keyword for the old parser (GH-20814)Pablo Galindo2020-06-115-11/+15
|
* bpo-40947: getpath.c uses PyConfig.platlibdir (GH-20807) (GH-20813)Victor Stinner2020-06-114-13/+23
| | | | | | | | | | | | 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 d72b9644a3e6eec83be48b1ebc2ec6ca776134d3)
* bpo-34401: Fix test_gdb for HP GDB version string (GH-20804)Miss Islington (bot)2020-06-112-1/+3
| | | | | | | | | | | 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 b2dca49ca3769cb60713f5c2b43e5d5bbdc1f9c7) Co-authored-by: Victor Stinner <vstinner@python.org>
* bpo-40939: Generate keyword.py using the new parser (GH-20800)Miss Islington (bot)2020-06-116-9/+88
| | | | | (cherry picked from commit 9727694f08cad4b019d2939224e3416312b1c0e1) Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
* Collections module reformatting and minor code refactoring (GH-20772) (GH-20798)Miss Islington (bot)2020-06-111-91/+271
|
* bpo-40847: Consider a line with only a LINECONT a blank line (GH-20769)Miss Islington (bot)2020-06-114-1/+27
| | | | | | | | | | | | | 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 896f4cf63f9ab93e30572d879a5719d5aa2499fb) Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
* bpo-40895: Update weakref documentation to remove old warnings (GH-20687)Miss Islington (bot)2020-06-101-16/+0
| | | | | | | | | | | | | 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: https://github.com/python/cpython/commit/c1baa601e2b558deb690edfdf334fceee3b03327GH-commitcomment-39514438 (cherry picked from commit 1642c0ef750f96664a98cadb09301d492098d2fb) Co-authored-by: Daniel Fortunov <asqui@users.noreply.github.com>
* bpo-40927: Fix test_binhex when run twice (GH-20764) (GH-20789)Victor Stinner2020-06-102-1/+3
| | | | | | test_binhex now uses import_fresh_module() to ensure that it raises DeprecationWarning each time. (cherry picked from commit 9c24e2e4c10705d95258558348417a28007dac66)
* bpo-40826: Fix test_repl.test_close_stdin() on Windows (GH-20779) (GH-20785)Victor Stinner2020-06-104-46/+42
| | | | | | | | | | | | | 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 f6e58aefde2e57e4cb11ea7743955da53a3f1e80)