Commit Graph

107796 Commits

Author SHA1 Message Date
Miss Islington (bot) 27b811057f
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:41:55 -07:00
Miss Islington (bot) f92544483f
bpo-41325: Add version note for args and kwargs property in call object (GH-21525)
(cherry picked from commit 9b01c598ca)

Co-authored-by: Jordan Speicher <uSpike@users.noreply.github.com>
2020-07-18 06:14:32 -07:00
Miss Islington (bot) 760552ceb8
bpo-41024: doc: Explicitly mention use of 'enum.Enum' as a valid container for '… (GH-20964) (GH-21527) 2020-07-17 16:43:03 -07:00
Miss Islington (bot) a16ac4e43c
bpo-41304: Update NEWS to include CVE-2020-15801 reference (GH-21521)
(cherry picked from commit 164b04c47e)

Co-authored-by: Steve Dower <steve.dower@python.org>
2020-07-17 17:53:56 +01:00
Miss Islington (bot) 5a7aa28045
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 15:42:09 -07:00
Miss Islington (bot) 9d8b8c3ed2
Fix trivial typo in the PEG string parser (GH-21508)
(cherry picked from commit 0275e0452a)

Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
2020-07-16 09:30:19 -07:00
Miss Islington (bot) 961703cdc8
Fix possibly-unitialized warning in string_parser.c. (GH-21503)
GCC says
```
../cpython/Parser/string_parser.c: In function ‘fstring_find_expr’:
../cpython/Parser/string_parser.c:404:93: warning: ‘cols’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  404 |     p2->starting_col_offset = p->tok->first_lineno == p->tok->lineno ? t->col_offset + cols : cols;
      |                               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
../cpython/Parser/string_parser.c:384:16: note: ‘cols’ was declared here
  384 |     int lines, cols;
      |                ^~~~
../cpython/Parser/string_parser.c:403:45: warning: ‘lines’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  403 |     p2->starting_lineno = t->lineno + lines - 1;
      |                           ~~~~~~~~~~~~~~~~~~^~~
../cpython/Parser/string_parser.c:384:9: note: ‘lines’ was declared here
  384 |     int lines, cols;
      |         ^~~~~
```

and, indeed, if `PyBytes_AsString` somehow fails, lines & cols will not be initialized.
(cherry picked from commit 2ad7e9c011)

Co-authored-by: Benjamin Peterson <benjamin@python.org>
2020-07-16 06:25:31 -07:00
Miss Islington (bot) f0f6566d47
Remove unnecessary spaces in code blocks in urllib.parse.rst (GH-21500)
This should also fix the syntax highlighting for these code blocks

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

Co-authored-by: Christopher Yeh <chrisyeh96@users.noreply.github.com>
2020-07-16 04:31:34 -07:00
Miss Islington (bot) 28e93dd2b2
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:14:48 -07:00
Miss Islington (bot) 4a02da4f95
bpo-40150: Fix mismatched argument in RegisterWaitForSingleObject() call (GH-19686)
(cherry picked from commit af4eda46d1)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2020-07-15 12:25:59 -07:00
Miss Islington (bot) 9080e1e3f4
Fix -Wstring-prototypes warnings in _zoneinfo.c. (GH-21478)
(cherry picked from commit 0108b2a240)

Co-authored-by: Benjamin Peterson <benjamin@python.org>
2020-07-15 10:23:43 -07:00
Miss Islington (bot) f2f6759a78
Fix -Wstrict-prototypes warning in thread_pthread.h. (GH-21477)
(cherry picked from commit ea62a4bd54)

Co-authored-by: Benjamin Peterson <benjamin@python.org>
2020-07-15 06:30:26 -07:00
Miss Islington (bot) 8ca63f95f7
bpo-41302: Fix build with system libmpdec (GH-21481)
Move definition of UNUSED from modified headers of libmpdec to
_decimal.c itself. This makes the vendored source closer to the
standalone library and fixes build with --with-system-libmpdec.

Tested to build fine with either system libmpdec or the vendored one.
(cherry picked from commit 015efdbef7)

Co-authored-by: Felix Yan <felixonmars@archlinux.org>
2020-07-15 06:01:10 -07:00
Miss Islington (bot) f3232294ee
[3.9] bpo-39017: Avoid infinite loop in the tarfile module (GH-21454) (GH-21482)
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:33 -07:00
Miss Islington (bot) 805874a9f1
Fix repeated words in Classes tutorial (GH-21455)
The phrase "At any time during execution," was repeated twice.

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

Co-authored-by: Paul McMillan <paul@mcmillan.ws>
2020-07-13 18:49:56 -07:00
Miss Islington (bot) 57c984fab6
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:09:27 -07:00
Miss Islington (bot) a77b1f6b5b
bpo-41228: Fix /a/are/ in monthcalendar() descripton (GH-21372)
(cherry picked from commit 344dce312a)

Co-authored-by: Nima Dini <nima.dini@gmail.com>
2020-07-10 19:07:37 -07:00
Miss Islington (bot) 3daf0017de
Fix typo in docs: 'created by th' -> 'created by the' (GH-21384)
(cherry picked from commit 6fc732a211)

Co-authored-by: marload <rladhkstn8@gmail.com>
2020-07-10 08:50:45 -07:00
Miss Islington (bot) 51b36ed96d
bpo-41175: Guard against a NULL pointer dereference within bytearrayobject (GH-21240)
The issue is triggered by the bytearray() + bytearray() operation.

Detected by GCC 10 static analysis tool.
(cherry picked from commit 61fc23ca10)

Co-authored-by: stratakis <cstratak@redhat.com>
2020-07-10 03:18:45 -07:00
Miss Islington (bot) fd27fb7f3d
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:14 -07:00
Miss Islington (bot) c65ee55512
bpo-41172: Fix check for compiler in test suite (GH-21400)
(cherry picked from commit af56c4fc76)

Co-authored-by: Steve Dower <steve.dower@python.org>
2020-07-09 11:12:07 -07:00
Miss Islington (bot) b4beda1a86
bpo-41199: Docstring convention not followed for dataclasses documentation page (GH-21413)
Automerge-Triggered-By: @ericvsmith
(cherry picked from commit 61bb24a270)

Co-authored-by: marload <rladhkstn8@gmail.com>
2020-07-09 05:20:26 -07:00
Miss Islington (bot) 90584c02b4
bpo-41252: Fix incorrect refcounting in _ssl.c's _servername_callback() (GH-21407)
(cherry picked from commit ee96f32ca2)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2020-07-09 03:18:30 -07:00
Miss Islington (bot) e68978978f
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:21:00 -07:00
Miss Islington (bot) fbd71f6684
bpo-41247: asyncio.set_running_loop() cache running loop holder (GH-21401)
The running loop holder cache variable was always set to NULL when
calling set_running_loop.

Now set_running_loop saves the newly created running loop holder in the
cache variable for faster access in get_running_loop.

Automerge-Triggered-By: @1st1
(cherry picked from commit 529f42645d)

Co-authored-by: Tony Solomonik <tony.solomonik@gmail.com>
2020-07-08 12:47:20 -07:00
Miss Islington (bot) a0a6f11678
Revert "bpo-40170: PyType_HasFeature() now always calls PyType_GetFlags() (GH-19378)" (GH-21390)
This partially reverts commit 45ec5b99ae.
(cherry picked from commit b26a0db8ea)

Co-authored-by: Victor Stinner <vstinner@python.org>
2020-07-08 02:19:38 -07:00
Miss Islington (bot) 1d1c574340
closes bpo-41235: Fix the error handling in SSLContext.load_dh_params() (GH-21385)
(cherry picked from commit aebc049557)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2020-07-07 21:40:18 -07:00
Miss Islington (bot) 366cfc65f2
bpo-41173: Copy test results file from ARM worker before uploading (GH-21305)
(cherry picked from commit 10772ec150)

Co-authored-by: Steve Dower <steve.dower@python.org>
2020-07-07 16:45:17 -07:00
Miss Islington (bot) 2c82628e9a
bpo-41207 In distutils.spawn, rewrite FileNotFound (GH-21359)
Automerge-Triggered-By: @jaraco
(cherry picked from commit 6ae2780be0)

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
2020-07-07 04:31:32 -07:00
Miss Islington (bot) edeaf61b68
bpo-41215: Make assertion in the new parser more strict (GH-21364)
(cherry picked from commit 782f44b8fb)

Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
2020-07-06 16:35:10 -07:00
Pablo Galindo 6488a4a3c9
[3.9] bpo-41218: Only mark async code with CO_COROUTINE. (GH-21357) (GH-21362)
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 bd46174)

Co-authored-by: Matthias Bussonnier <bussonniermatthias@gmail.com>

Co-authored-by: Matthias Bussonnier <bussonniermatthias@gmail.com>
2020-07-06 23:30:20 +01:00
Pablo Galindo 54f115dd53
[3.9] bpo-41215: Don't use NULL by default in the PEG parser keyword list (GH-21355) (GH-21356)
(cherry picked from commit 39e76c0fb0)

Co-authored-by: Pablo Galindo <pablogsal@gmail.com>

Automerge-Triggered-By: @lysnikolaou
2020-07-06 12:29:59 -07:00
Miss Islington (bot) 4981fe36c7
bpo-29778: Ensure python3.dll is loaded from correct locations when Python is embedded (GH-21297)
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 09:52:13 -07:00
Dong-hee Na 97558d6b08
[3.9] bpo-37207: Update whatsnews for 3.9 (GH-21337)
(cherry picked from commit b4a9263)

Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
2020-07-06 22:32:06 +09:00
Miss Islington (bot) 1ce59f0421
bpo-41165: Deprecate PyEval_ReleaseLock() (GH-21309)
(cherry picked from commit 9ce8132e1f)

Co-authored-by: Inada Naoki <songofacandy@gmail.com>
2020-07-05 20:25:14 -07:00
Miss Islington (bot) 00c09f06a4
bpo-28681: Clarify multiple function names in the tutorial (GH-21340) (GH-21343)
* improve control flow docs

* Add also

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>

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

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

Co-authored-by: Joannah Nanjekye <33177550+nanjekyejoannah@users.noreply.github.com>
2020-07-05 23:07:32 -03:00
Miss Islington (bot) 3f4a9fd912
bpo-26205: Specify the number of nested scopes (GH-21324) (GH-21341)
* Clarify number of scopes

* Indicate 3 or 4

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>

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

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

Co-authored-by: Joannah Nanjekye <33177550+nanjekyejoannah@users.noreply.github.com>
2020-07-05 23:06:16 -03:00
Miss Islington (bot) 5a1384935e
bpo-39168: Remove the __new__ method of typing.Generic (GH-21327)
Automerge-Triggered-By: @gvanrossum
(cherry picked from commit 7fed75597f)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2020-07-05 09:02:40 -07:00
Inada Naoki 16f451744b
bpo-41211: Doc: Fix PyLong_FromUnicode (GH-21331)
PyUnicode_EncodeDecimal is not used actually.
2020-07-05 14:28:38 +09:00
Miss Islington (bot) 48f388f02f
bpo-41211: Doc: Fix PyLong_FromUnicodeObject (GH-21325)
It doesn't use PyUnicode_EncodeDecimal. It uses a private API instead.
(cherry picked from commit 9c84417122)

Co-authored-by: Inada Naoki <songofacandy@gmail.com>
2020-07-04 21:08:39 -07:00
Miss Islington (bot) 9c38408708
Uncomment Py_DEPRECATED for Py_UNICODE APIs (GH-21318)
PyUnicode_EncodeDecimal and PyUnicode_TransformDecimalToASCII
are deprecated since Python 3.3.
But Py_DEPRECATED(3.3) was commented out.
(cherry picked from commit 13c90e82b6)

Co-authored-by: Inada Naoki <songofacandy@gmail.com>
2020-07-04 19:19:40 -07:00
Miss Islington (bot) 1cbcf9833f
bpo-33864: Clarify the docs for typing.ByteString (GH-21311)
(cherry picked from commit b40e434386)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2020-07-03 21:05:41 -07:00
Steve Dower 941117aaa3
bpo-21222: Fix improperly merged change so that final hooks are called before types are cleared (GH-21304) 2020-07-03 23:34:46 +01:00
Steve Dower e1d4fdc533
bpo-41162: Clear audit hooks later during finalization (GH-21222)
Co-authored-by: Konge <zkonge@outlook.com>
2020-07-03 22:58:29 +01:00
Miss Islington (bot) 1c776541a8
bpo-41180: Audit code.__new__ when unmarshalling (GH-21271)
(cherry picked from commit d160e0f8e2)

Co-authored-by: tkmikan <36260601+tkmikan@users.noreply.github.com>
2020-07-03 14:16:23 -07:00
Łukasz Langa c1feaa5468
Post 3.9.0b4 2020-07-03 18:47:54 +02:00
Łukasz Langa b0bb791313 Python 3.9.0b4
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEE4/8oOcBIslwITevpsmmV4xAlBWgFAl7+ICsACgkQsmmV4xAl
 BWjNgg//fTnAwme/3pJU6MiYy9K6nes+498B9pjqbmm08Afb7n7Jx/N8hKr7Bx7w
 QL7KzXltmGyKQwU7D9436eXCWkkkYn5wGt/snsgPAxf0wgg2T9vaJMvw48XNZatD
 zRY8Jh9fdKZMA3HN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PwOjUmENn8WBwD5bjHO
 PWA2dSazN1ZzaLmngNOx1NBwLu7p85dMpnYSiG1qKRpsD5DtCbKS0tSHdExSmhHT
 3Ju2oInJcswWqk2SVHDauq3ocLxaYlf0lRl71G6p56eN9DrTSj0wDrhjoseRpNkm
 s0ZrpCUYZWR3T9kTTxJjYTnoA1x7TybOSJFHe+dKVfggO0n2/Ytuy+HOTRY+BPrc
 0x2TNbfkAL2Vla5e5wxv+zQkZhBoRZRpf1k3A5mJg8ZMC9c69HEpMDEJI8wzQd0a
 kf+T+XzuUIdS/lzFTWu/KWRXpNj9PXsjjN6vbmDC3U0qcU2y27bQKfFWwX/nyROe
 onLsxvD8EQ==
 =Y3oI
 -----END PGP SIGNATURE-----

Merge tag 'v3.9.0b4' into 3.9

Python 3.9.0b4
2020-07-03 18:47:34 +02:00
Victor Stinner f8599279b6
[3.9] bpo-41194: The _ast module cannot be loaded more than once (GH-21290) (GH-21292)
* bpo-41194: Pass module state in Python-ast.c (GH-21284)

Rework asdl_c.py to pass the module state to functions in
Python-ast.c, instead of using astmodulestate_global.

Handle also PyState_AddModule() failure in init_types().

(cherry picked from commit 74419f0c64)

* bpo-41194: The _ast module cannot be loaded more than once (GH-21290)

Fix a crash in the _ast module: it can no longer be loaded more than
once. It now uses a global state rather than a module state.

* Move _ast module state: use a global state instead.
* Set _astmodule.m_size to -1, so the extension cannot be loaded more
  than once.

(cherry picked from commit 91e1bc18bd)
2020-07-03 16:57:19 +02:00
Miss Islington (bot) 486c256bdf
Improve code organization for the random module (GH-21161) (GH-21163) 2020-07-02 18:12:50 -07:00
Miss Islington (bot) bfec674254
bpo-39960: Allow heap types in the "Carlo Verre" hack check that override "tp_setattro()" (GH-21092)
Automerge-Triggered-By: @gvanrossum
(cherry picked from commit 148f329135)

Co-authored-by: scoder <stefan_ml@behnel.de>
2020-07-02 17:28:41 -07:00