Commit Graph

110104 Commits

Author SHA1 Message Date
Miss Islington (bot) 46f96f00f7
Fix compiler warning for misleading guarding in the tkinter (GH-26244) (GH-26251)
The newest gcc emmits this warning:

```
/Modules/_tkinter.c:272:9: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
  272 |         if(tcl_lock)PyThread_acquire_lock(tcl_lock, 1); tcl_tstate = tstate; }
      |         ^~
/Modules/_tkinter.c:2869:5: note: in expansion of macro ‘LEAVE_PYTHON’
 2869 |     LEAVE_PYTHON
      |     ^~~~~~~~~~~~
/Modules/_tkinter.c:243:5: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
  243 |     (*(PyThreadState**)Tcl_GetThreadData(&state_key, sizeof(PyThreadState*)))
      |     ^
/Modules/_tkinter.c:272:57: note: in expansion of macro ‘tcl_tstate’
  272 |         if(tcl_lock)PyThread_acquire_lock(tcl_lock, 1); tcl_tstate = tstate; }
      |                                                         ^~~~~~~~~~
/Modules/_tkinter.c:2869:5: note: in expansion of macro ‘LEAVE_PYTHON’
 2869 |     LEAVE_PYTHON

```

that's because the macro packs together two statements at the same level
as the "if". The warning is misleading but is very noisy so it makes
sense to fix it.
(cherry picked from commit 95d04710c5)

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

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2021-05-19 19:46:45 +01:00
Miss Islington (bot) ec0699c044
bpo-44168: Fix error message in the parser for keyword arguments for invalid expressions (GH-26210) (GH-26247)
(cherry picked from commit 33c0c90dea)

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

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2021-05-19 19:28:31 +01:00
Miss Islington (bot) e87fd41d02
Fix compiler warning in the xml module (GH-26245) (GH-26249)
The newest version of gcc complains about passing un-initialized arrays
as constant pointers:

```
/Modules/expat/xmltok_ns.c: In function ‘findEncodingNS’:
/Modules/expat/xmltok.h:272:10: warning: ‘buf’ may be used uninitialized [-Wmaybe-uninitialized]
  272 |   (((enc)->utf8Convert)(enc, fromP, fromLim, toP, toLim))
      |   ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Modules/expat/xmltok_ns.c:95:3: note: in expansion of macro ‘XmlUtf8Convert’
   95 |   XmlUtf8Convert(enc, &ptr, end, &p, p + ENCODING_MAX - 1);
      |   ^~~~~~~~~~~~~~
/Modules/expat/xmltok.h:272:10: note: by argument 5 of type ‘const char *’ to ‘enum XML_Convert_Result(const ENCODING *, const char **, const char *, char **, const char *)’ {aka ‘enum XML_Convert_Result(const struct encoding *, const char **, const char *, char **, const char *)’}
  272 |   (((enc)->utf8Convert)(enc, fromP, fromLim, toP, toLim))
      |   ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Modules/expat/xmltok_ns.c:95:3: note: in expansion of macro ‘XmlUtf8Convert’
   95 |   XmlUtf8Convert(enc, &ptr, end, &p, p + ENCODING_MAX - 1);
      |   ^~~~~~~~~~~~~~
In file included from /Modules/expat/xmltok.c:1657:
/Modules/expat/xmltok_ns.c:92:8: note: ‘buf’ declared here
   92 |   char buf[ENCODING_MAX];

```
(cherry picked from commit be93f81e58)

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

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2021-05-19 19:21:19 +01:00
Miss Islington (bot) 3357604db9
bpo-44010: IDLE: colorize pattern-matching soft keywords (GH-25851)
(cherry picked from commit 60d343a816)

Co-authored-by: Tal Einat <532281+taleinat@users.noreply.github.com>
2021-05-19 02:44:14 -07:00
Miss Islington (bot) 5f2afff1dd
bpo-35765: Clarify references to "object x" in the JSON tutorial (GH-22411) (GH-26218)
(cherry picked from commit 4fdcc39f71)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2021-05-19 09:59:23 +01:00
Miss Islington (bot) e57bef1b73
bpo-44106: Purge unused sqlite3 doc includes (GH-26234)
(cherry picked from commit d798acc873)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
2021-05-19 11:17:19 +03:00
Miss Islington (bot) 3185bc9d3f
bpo-44106: Improve sqlite3 example database contents (GH-26027)
(cherry picked from commit 92d1064727)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
2021-05-19 10:44:00 +03:00
Miss Islington (bot) 1f483c0c1b
bpo-30593: Doc'ed that executescript() disregards isolation level (GH-26220)
(cherry picked from commit 9014437573)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
2021-05-19 10:37:33 +03:00
Łukasz Langa 4d17c93dfe
[3.10] bpo-41963: document that ConfigParser strips off comments (GH-26197) (GH-26214)
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Laura Gutierrez Funderburk <58710704+lgfunderburk@users.noreply.github.com>
Co-authored-by: Jürgen Gmach <juergen.gmach@googlemail.com>

(cherry picked from commit 02ee819126)
2021-05-18 19:03:09 +02:00
Irit Katriel 373741a97c
[3.10] bpo-25872: Add unit tests for linecache and threading (GH-25913) (GH-26212)
(cherry picked from commit 115dea9e26)

Co-authored-by: uniocto <serit142sa33go@gmail.com>
2021-05-18 14:53:57 +01:00
Miss Islington (bot) a44bb6ddb1
bpo-33433 Fix private address checking for IPv4 mapped IPv6. (GH-26172)
For IPv4 mapped IPv6 addresses, defer privacy check to the mapped IPv4 address. Solves bug where public mapped IPv4 addresses are considered private by the IPv6 check.

Automerge-Triggered-By: GH:gpshead
(cherry picked from commit 83f0f8d62f)

Co-authored-by: Pete Wicken <2273100+JamoBox@users.noreply.github.com>
2021-05-17 12:42:08 -07:00
Miss Islington (bot) 7a588621c2
bpo-43650: Fix MemoryError on zip.read in shutil._unpack_zipfile for large files (GH-25058) (GH-26190)
`shutil.unpack_archive()` tries to read the whole file into memory, making no use of any kind of smaller buffer. Process crashes for really large files: I.e. archive: ~1.7G, unpacked: ~10G. Before the crash it can easily take away all available RAM on smaller systems. Had to pull the code form `zipfile.Zipfile.extractall()` to fix this

Automerge-Triggered-By: GH:gpshead
(cherry picked from commit f32c7950e0)

Co-authored-by: Igor Bolshakov <ibolsch@gmail.com>
2021-05-17 10:35:30 -07:00
Miss Islington (bot) 60fa8b32db
bpo-44145: Release the GIL around HMAC_Update. (GH-26157)
It was always meant to be released for parallelization.
This now matches the other similar code in the module.

Thanks michaelforney for noticing!
(cherry picked from commit c10392e7dd)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2021-05-17 01:03:57 -07:00
Miss Islington (bot) e6755ba94b
Apply edits from Allen Downey's review of the linear_regression docs. (GH-26176) (GH-26185) 2021-05-16 19:47:57 -07:00
Miss Islington (bot) d49877e6e7
[doc] Fix typo in os module (GH-24464)
Automerge-Triggered-By: GH:iritkatriel
(cherry picked from commit fdc7e52f5f)

Co-authored-by: Rafael Fontenelle <rffontenelle@users.noreply.github.com>
2021-05-16 16:59:12 -07:00
Miss Islington (bot) d22fa22cca
fix docstring typo in bdb.py (GH-22323) (#26179)
(cherry picked from commit be54fb5ae7)

Co-authored-by: flizzywine <1041958497@qq.com>
2021-05-17 00:42:56 +01:00
Miss Islington (bot) 52461cb1be
Fix a typo/error in a news entry (bidst_wheel -> bdist_wheel) (GH-24284) (#26181)
Automerge-Triggered-By: GH:iritkatriel
(cherry picked from commit 56df20d701)


Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2021-05-17 00:41:05 +01:00
Miss Islington (bot) b913f47e87
bpo-39950: Fix deprecation warning in test for `pathlib.Path.link_to()` (GH-26155) (GH-26178)
(cherry picked from commit 1a08c5ac49)

Co-authored-by: Barney Gale <barney.gale@gmail.com>
2021-05-16 15:35:44 -07:00
Miss Islington (bot) 68b79f75c5
[3.10] Fix typo in comment (GH-26162) (GH-26164)
(cherry picked from commit de367378f6)


Co-authored-by: Ashwin Ramaswami <aramaswamis@gmail.com>

Automerge-Triggered-By: GH:iritkatriel
2021-05-16 11:08:57 -07:00
Irit Katriel 9b59b6fff8
[3.10] Remove a redundant assignment in Tools/unittestgui/unittestgui.py (GH-21438) (GH-26171)
(cherry picked from commit a42d98ed91)

Co-authored-by: Serhii Hidenko <shidenko97@gmail.com>
2021-05-16 17:56:15 +01:00
Miss Islington (bot) 1afaaf5a2d
bpo-44143: Fix crash in the parser when raising tokenizer errors with an exception set (GH-26144) (GH-26148)
(cherry picked from commit 80b089179f)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2021-05-15 18:39:18 +01:00
Miss Islington (bot) a38db84122
bpo-32133: Improve numbers docs (GH-26124) (GH-26149) 2021-05-15 10:28:55 -07:00
Miss Islington (bot) 67729a91a5
bpo-44139: Use a more descriptive syntax error comprehension case in the What's New for 3.10 (GH-26145) (GH-26146)
(cherry picked from commit c5b833046d)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2021-05-15 17:56:28 +01:00
Miss Islington (bot) 71dca6ea73
[3.10] bpo-37788: Fix reference leak when Thread is never joined (GH-26103) (GH-26138)
When a Thread is not joined after it has stopped, its lock may remain in the _shutdown_locks set until interpreter shutdown.  If many threads are created this way, the _shutdown_locks set could therefore grow endlessly.  To avoid such a situation, purge expired locks each time a new one is added or removed.
(cherry picked from commit c10c2ec7a0)


Co-authored-by: Antoine Pitrou <antoine@python.org>
2021-05-15 02:24:44 -07:00
Miss Islington (bot) 2e99869f64
bpo-44072: fix Complex, Integral docs for `**` (GH-25986)
In numbers module docstrings and docs.
(cherry picked from commit 4aa63d65a9)

Co-authored-by: Rory Yorke <rory.yorke@gmail.com>
2021-05-14 15:22:45 -07:00
Miss Islington (bot) dd4f7d96cb
bpo-43729: Clarify comment in tutorial example (GH-25191) (#26136)
(cherry picked from commit 07797121cc)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
2021-05-14 13:06:09 -07:00
Miss Islington (bot) 623481c77b
Subprocess Protocols Documentation (GH-20950) (GH-26133) 2021-05-14 10:22:55 -07:00
Irit Katriel 23643799ac
[3.10] [doc] Fix typos in cgi.rst (GH-24766) (GH-26132)
(cherry picked from commit 19d839ae20)

Co-authored-by: Géry Ogam <gery.ogam@gmail.com>
2021-05-14 18:12:33 +01:00
Miss Islington (bot) 8940916a02
Update doc as relative import can be used with star import (GH-25667) (GH-26121)
(cherry picked from commit 3d4b5f1019)

Co-authored-by: Saiyang Gou <gousaiyang@163.com>

Co-authored-by: Saiyang Gou <gousaiyang@163.com>
2021-05-14 07:26:40 -07:00
Miss Islington (bot) 5abc681019
Reword paragraph on specific value for Py_LIMITED_API (GH-26101) (GH-26123)
(cherry picked from commit ddd30b2dd2)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2021-05-14 14:28:08 +02:00
Miss Islington (bot) f28bac428d
bpo-44108: sqlite3 test suite now works with SQLITE_DQS=0 (GH-26032) (GH-26125)
(cherry picked from commit be7e467bcf)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
2021-05-14 20:07:24 +09:00
Miss Islington (bot) 464269778b
Updated code example for asyncio.gather (GH-20604) (GH-26119)
The previous example did not fully showcase the interest of using gather.

Here the example showcases "the result is an aggregate list of returned values".
(cherry picked from commit 56b8ea65d2)

Co-authored-by: josephernest <nouvellecollection@gmail.com>

Co-authored-by: josephernest <nouvellecollection@gmail.com>
2021-05-13 23:07:20 -07:00
Miss Islington (bot) e7d25d3f3b
bpo-43977: Update pattern matching language reference docs (GH-25917) (GH-26117)
* Update patma language reference with new changes to sequence and mapping

* update 3.10 whatsnew too
(cherry picked from commit 53c91ac525)

Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>

Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
2021-05-13 22:55:41 -07:00
Miss Islington (bot) 373937182e
bpo-43795: PEP 652 user documentation (GH-25668) (GH-26034)
- Reformat the C API and ABI Versioning page (and extend/clarify a bit)
- Rewrite the stable ABI docs into a general text on C API Compatibility
- Add a list of Limited API contents, and notes for the individual items.
- Replace `Include/README.rst` with a link to a devguide page with the same info
(cherry picked from commit b05955d6f5)

Co-authored-by: Petr Viktorin <encukou@gmail.com>

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2021-05-13 22:29:09 -07:00
Miss Islington (bot) ea14a0749a
bpo-43757: Document os.path.realpath(strict=True) in 3.10 whatsnew. (GH-26090) (#26099)
(cherry picked from commit d1560d2429)

Co-authored-by: Barney Gale <barney.gale@gmail.com>

Co-authored-by: Barney Gale <barney.gale@gmail.com>
2021-05-13 22:24:13 -07:00
Miss Islington (bot) 3222b25b2f
[3.10] bpo-43908: Add What's New entry for Py_TPFLAGS_IMMUTABLETYPE flag (GH-25816) (GH-26115)
(cherry picked from commit a09fc9c63f)


Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>

Automerge-Triggered-By: GH:gvanrossum
2021-05-13 16:04:15 -07:00
Miss Islington (bot) 2d780237d9
bpo-28146: Fix a confusing error message in str.format() (GH-24213)
Automerge-Triggered-By: GH:pitrou
(cherry picked from commit 4aeee0b47b)

Co-authored-by: Irit Katriel <iritkatriel@yahoo.com>
2021-05-13 14:24:49 -07:00
Miss Islington (bot) c4c3beb5ad
bpo-44114: Remove redundant cast. (GH-26098)
(cherry picked from commit e0c614e5fd)

Co-authored-by: Inada Naoki <songofacandy@gmail.com>
2021-05-13 14:07:31 -07:00
Miss Islington (bot) 336dc523a4
bpo-44125: Fix "make patchcheck" on non-English locale (GH-26102)
The patch from [bpo-44074]() does not account for a possibly non-English locale and blindly greps for "HEAD branch" in a possibly localized text.

Automerge-Triggered-By: GH:pitrou
(cherry picked from commit 1aa3530314)

Co-authored-by: Antoine Pitrou <antoine@python.org>
2021-05-13 11:42:31 -07:00
Miss Islington (bot) c55ff1b352
bpo-44098: Drop ParamSpec from most ``__parameters__`` in typing generics (GH-26013) (#26091)
Added two new attributes to ``_GenericAlias``:
* ``_typevar_types``, a single type or tuple of types indicating what types are treated as a ``TypeVar``. Used for ``isinstance`` checks.
* ``_paramspec_tvars ``, a boolean flag which guards special behavior for dealing with ``ParamSpec``. Setting it to ``True`` means this  class deals with ``ParamSpec``.

Automerge-Triggered-By: GH:gvanrossum
(cherry picked from commit b2f3f8e3d8)
2021-05-13 10:19:24 -07:00
Mark Shannon 0acdf255a5
[3.10] bpo-43933: Force RETURN_VALUE bytecodes to have line numbers (GH-26061)
* Guarantee that line number is set for returns.
2021-05-13 14:11:41 +01:00
Miss Islington (bot) 2d972b8e7c
bpo-39906: Document new follow_symlinks argument to pathlib.Path.stat() and chmod() in 3.10 whatsnew. (GH-26089)
(cherry picked from commit 366c69f3f6)

Co-authored-by: Barney Gale <barney.gale@gmail.com>
2021-05-13 05:35:01 -07:00
Miss Islington (bot) 7cbe6ca634
bpo-44114: Fix dictkeys_reversed and dictvalues_reversed function signatures (GH-26062)
These are passed and called as PyCFunction, however they are defined here without the (ignored) args parameter.

This works fine in some C compilers, but fails in webassembly or anything else that has strict function pointer call type checking.
(cherry picked from commit ab383eb6f0)

Co-authored-by: Joe Marshall <joe.marshall@nottingham.ac.uk>
2021-05-13 01:17:07 -07:00
Miss Islington (bot) 6275ea0282
bpo-44030: Fix formatting error in exceptions docs (GH-25929) (GH-26086)
(cherry picked from commit 8ea350ee90)

Co-authored-by: Miguel Brito <5544985+miguendes@users.noreply.github.com>
2021-05-13 01:27:08 +01:00
Miss Islington (bot) ba260acb22
bpo-44116: Add GC support to _csv heap types (GH-26074) (GH-26081)
(cherry picked from commit e5ba1fe995)
2021-05-12 19:56:19 +01:00
Miss Islington (bot) 1ee58f2524
bpo-40645: Fix ref leaks in _hashopenssl (GH-26079)
(cherry picked from commit 504ffdae4e)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
2021-05-12 11:45:06 -07:00
Miss Islington (bot) a2d94a0a9b
bpo-38908: Fix issue when non runtime_protocol failed to raise TypeError (GH-26067)
(cherry picked from commit c40486a32d)

Co-authored-by: Yurii Karabas <1998uriyyo@gmail.com>
2021-05-12 09:09:04 -07:00
Irit Katriel bd5dfd6c8c
[3.10] bpo-25479: add unit test for __subclasshook__ in test_abc.py (GH-24034) (GH-26065)
Co-authored-by: Szymon Trapp
(cherry picked from commit 5010c044c7)

Co-authored-by: Karl Dubost <karl+github@la-grange.net>
2021-05-12 15:06:34 +01:00
Miss Islington (bot) 3e44e9af9e
bpo-44089: Allow subclassing of ``csv.Error`` (GH-26008) (GH-26066)
* fix subclass error

* Update 2021-05-09-22-52-34.bpo-44089.IoANsN.rst
(cherry picked from commit 2b458c1dba)

Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>

Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
2021-05-12 07:02:46 -07:00
Miss Islington (bot) 48cb11bf5b
bpo-40640: doc -- add missing ... in example of Continue (GH-26055) (GH-26057)
Co-authored-by: Chas Belov <59780179+ChasBelov@users.noreply.github.com>
(cherry picked from commit 6574334a68)


Co-authored-by: Irit Katriel <iritkatriel@yahoo.com>
2021-05-12 11:25:54 +01:00