Commit Graph

107446 Commits

Author SHA1 Message Date
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
 BWjzUxAAmbCfQsA5KW2o8fyj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gqqYoJs3pZSGphnpkQqRcngfueefwMDCzl74s5zLt25MIuHacdFhLExuW5o44
 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
Łukasz Langa 0b1a1c8c4c
Python 3.9.0b2 2020-06-08 20:41:34 +02:00
Miss Islington (bot) 3dc4428a37
Add multicore support to deccheck.py. (GH-20731)
(cherry picked from commit 951d680d56)

Authored-by: Stefan Krah <skrah@bytereef.org>
2020-06-08 19:55:13 +02:00
Miss Islington (bot) ecdd28c8ff
Remove deleted libmpdec header from the Visual Studio build machinery. (GH-20730)
(cherry picked from commit 0c59f440f4)

Authored-by: Stefan Krah <skrah@bytereef.org>
2020-06-08 19:51:06 +02:00
Victor Stinner 817506432d
bpo-40854: Allow overriding sys.platlibdir via PYTHONPLATLIBDIR env-var (GH-20605) (GH-20725)
(cherry picked from commit 8f023a2f66)

Co-authored-by: Sandro Mani <manisandro@gmail.com>
2020-06-08 19:36:13 +02:00
Miss Islington (bot) 298c8c895f
bpo-40861: Enable optimizations when building liblzma (GH-20724)
(cherry picked from commit 3a3a30c5a4)

Co-authored-by: Steve Dower <steve.dower@python.org>
2020-06-08 10:09:01 -07:00
Victor Stinner dedaac040f
bpo-40910: Export Py_GetArgcArgv() function (GH-20721) (GH-20723)
Export explicitly the Py_GetArgcArgv() function to the C API and
document the function. Previously, it was exported implicitly which
no longer works since Python is built with -fvisibility=hidden.

* Add PyConfig._orig_argv member.
* Py_InitializeFromConfig() no longer calls _PyConfig_Write() twice.
* PyConfig_Read() no longer initializes Py_GetArgcArgv(): it is now
  _PyConfig_Write() responsibility.
* _PyConfig_Write() result type becomes PyStatus instead of void.
* Write an unit test on Py_GetArgcArgv().

(cherry picked from commit e81f6e687d)
2020-06-08 18:44:50 +02:00
Miss Islington (bot) 1220a47079
bpo-33187: Document 3.9 changes to xml.etree.ElementInclude.include (GH-20438)
Looks like the merging of bpo-33187 and bpo-20928 was racy, resulting in
this change going undocumented.
(cherry picked from commit 301f0d4ff9)

Co-authored-by: Shantanu <hauntsaninja@users.noreply.github.com>
2020-06-08 07:47:46 -07:00
Ned Deily 60edee8adb
Update macOS installer welcome files for 3.9.0 beta (GH-20719) 2020-06-08 08:47:27 -04:00
Pablo Galindo 2b33cc3a25
[3.9] Remove PEG-specific syntax error check in the old parser (GH-20717) 2020-06-08 11:27:58 +01:00
Miss Islington (bot) 8df4f3942f
bpo-40903: Handle multiple '=' in invalid assignment rules in the PEG parser (GH-20697)
Automerge-Triggered-By: @pablogsal
(cherry picked from commit 9f495908c5)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2020-06-08 02:22:06 -07:00
Miss Islington (bot) 66605d1572
allow macOS installer builds to package pre-built html docs (GH-20715)
build-installer now looks in its directory of source tarballs
for a suitable html tarball of the same version.  If so, it
will unpack and use it rather than rebuilding the html format
documentation set from the source repo.  This is intended as
a speedup for test builds of the installer.  Files names must
be in the same format as produced by the docs build for download,
for example, `python-3.9.0b1-docs-html.tar.bz2`.
(cherry picked from commit 63fc55b2ea)

Co-authored-by: Ned Deily <nad@python.org>
2020-06-08 01:11:43 -07:00
Miss Islington (bot) 3deded947c
Deny eval() direct access to builtins (GH-20713) (GH-20714) 2020-06-08 00:19:27 -07:00
Miss Islington (bot) be5ed59e29
bpo-22021: Update root_dir and base_dir documentation in shutil (GH-10367)
Also added an example in shutil in order to make more clear how they are to be used.

Initially reported by Weinan Li on bpo.
(cherry picked from commit 7633371dac)

Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
2020-06-07 22:08:14 -07:00
Miss Islington (bot) 1e72fb2b78
bpo-40741: Update macOS installer to use SQLite 3.32.2. (GH-20705)
(cherry picked from commit 37eed5a9ee)

Co-authored-by: Ned Deily <nad@python.org>
2020-06-07 19:43:11 -07:00
Miss Islington (bot) 9cf1be46e3
bpo-39791 native hooks for importlib.resources.files (GH-20576)
* Provide native .files support on SourceFileLoader.

* Add native importlib.resources.files() support to zipimporter. Remove fallback support.

* make regen-all

* 📜🤖 Added by blurb_it.

* Move 'files' into the ResourceReader so it can carry the relevant module name context.

* Create 'importlib.readers' module and add FileReader to it.

* Add zip reader and rely on it for a TraversableResources object on zipimporter.

* Remove TraversableAdapter, no longer needed.

* Update blurb.

* Replace backslashes with forward slashes.

* Incorporate changes from importlib_metadata 2.0, finalizing the interface for extension via get_resource_reader.

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

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
2020-06-07 18:30:08 -07:00
Miss Islington (bot) 6440911736
bpo-40904: Fix segfault in the new parser with f-string containing yield statements with no value (GH-20701)
(cherry picked from commit 972ab03276)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2020-06-07 18:08:53 -07:00
Miss Islington (bot) 71f501698d
bpo-39791: Support file systems that cannot support non-ascii filenames (skipping tests in that case). (GH-20681)
(cherry picked from commit 2efe18bf27)

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
2020-06-07 08:17:45 -07:00
Miss Islington (bot) 1d711f2e31
bpo-40724: Fix return type of test helper function heapctypewithbuffer_releasebuffer() (GH-20685) (GH-20690)
(cherry picked from commit b8867e5d5a)
Co-authored-by: Rémi Lapeyre <remi.lapeyre@lenstra.fr>
2020-06-07 09:28:03 +02:00
Miss Islington (bot) 1e4fa91104
bpo-40724: Support setting buffer slots from type specs (GH-20648) (GH-20683)
This is not part of the limited API but makes the buffer slots available for type specs.
(cherry picked from commit f7c4e23642)
2020-06-07 09:06:40 +02:00
Miss Islington (bot) 90ee51f1cd
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:38 -07:00
Miss Islington (bot) 18f1226884
Refactor scripts in Tools/peg_generator/scripts (GH-20401)
(cherry picked from commit ba6fd87e41)

Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
2020-06-05 21:41:12 -07:00
Miss Islington (bot) d5e7348e41
bpo-40862: Raise TypeError when const is given to argparse.BooleanOptionalAction (GH-20623) (GH-20664) 2020-06-05 19:31:18 -07:00
Miss Islington (bot) 15fec5627a
bpo-40880: Fix invalid read in newline_in_string in pegen.c (GH-20666)
* bpo-40880: Fix invalid read in newline_in_string in pegen.c

* Update Parser/pegen/pegen.c

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

* Add NEWS entry

Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
(cherry picked from commit 2e6593db00)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2020-06-05 17:13:14 -07:00
Miss Islington (bot) 79e6c15aed
bpo-40883: Fix memory leak in fstring_compile_expr in parse_string.c (GH-20667)
(cherry picked from commit a54096e305)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2020-06-05 17:10:57 -07:00
Miss Islington (bot) a4fa9a9515
bpo-39791: Refresh importlib.metadata from importlib_metadata 1.6.1. (GH-20659) (GH-20661)
* Refresh importlib.metadata from importlib_metadata 1.6.1.

* 📜🤖 Added by blurb_it.

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

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

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
2020-06-05 17:46:24 -04:00
Miss Islington (bot) cdc3d9cb22
Fix missing FloatOperation in EXTRA_FUNCTIONALITY path. (GH-20655) (#20660)
(cherry picked from commit 5fe1df1886)

Authored-by: Stefan Krah <skrah@bytereef.org>
2020-06-05 22:22:49 +02:00
Miss Islington (bot) 83bff88b4b
bpo-40874: Update to libmpdec-2.5.0 (GH-20652)
(cherry picked from commit 087d612efe)

Authored-by: Stefan Krah <skrah@bytereef.org>
2020-06-05 21:41:17 +02:00