Commit Graph

114738 Commits

Author SHA1 Message Date
Michael Droettboom cfbc7dd910
gh-94808: Coverage: Check picklablability of calliter (#95923) 2022-10-03 13:50:30 -07:00
MonadChains 9302e331c7
gh-94808: Add test coverage for PyObject_HasAttrString (#96627)
* gh-94808: Add test for HasAttrString

* Harmonize to Python C code style guidelines

* Add check to verify no exception thrown
2022-10-03 13:37:15 -07:00
hetmankp 3a49dbb98c
gh-94732: Fix KeyboardInterrupt race in asyncio run_forever() (#97765)
Ensure that the event loop's `_thread_id` attribute and the asyncgen hooks set by `sys.set_asyncgen_hooks()` are always restored no matter where a KeyboardInterrupt exception is raised.
2022-10-03 13:34:35 -07:00
Nikita Sobolev 873a2f2527
Fix typos in `bltinmodule.c`. (GH-97766) 2022-10-03 12:09:03 -07:00
Nikita Sobolev e990c6af08
gh-94808: `_PyLineTable_StartsLine` was not used (GH-96609) 2022-10-03 19:35:43 +01:00
Victor Stinner 64fe343717
gh-97681: Remove Tools/demo/ directory (#97682)
Remove the Tools/demo/ directory which contained old demo scripts. A
copy can be found in the old-demos project:
https://github.com/gvanrossum/old-demos

Remove the following old demo scripts:

* beer.py
* eiffel.py
* hanoi.py
* life.py
* markov.py
* mcast.py
* queens.py
* redemo.py
* rpython.py
* rpythond.py
* sortvisu.py
* spreadsheet.py
* vector.py

Changes:

* Remove a reference to the redemo.py script in the regex howto
  documentation.
* Remove a reference to the removed Tools/demo/ directory in the
  curses documentation.
* Update PC/layout/ to remove the reference to Tools/demo/ directory.
2022-10-03 17:09:02 +02:00
annonm e6f9ec5c03
Fix typo in unittest docs (#97742) 2022-10-03 06:35:40 -07:00
Serhiy Storchaka 0ee9619a4c
gh-97728: Argument Clinic: Fix uninitialized variable in the Py_UNICODE converter (GH-97729)
It affects function os.system() on Windows and Windows-specific modules
winreg, _winapi, _overlapped, and _msi.
2022-10-03 10:42:54 +03:00
C.A.M. Gerlach e738b5190b
gh-95913: Fix PEP number in PEP 678 What's New ref label (#97739)
What's New: Fix PEP number in PEP 678 ref target label
2022-10-03 06:12:37 +02:00
C.A.M. Gerlach bd00112a99
gh-95913: Copyedit/improve New Modules What's New section (#97721)
* Link TOML & WSGI in New Modules section, refine text & add ref label

* Further reformat new modules & add PEP link to tomllib
2022-10-03 06:04:10 +02:00
C.A.M. Gerlach 9148c0d893
gh-97740: Fix bang in Sphinx C domain ref target syntax (#97741)
* gh-97740: Fix bang in Sphinx C domain ref target syntax

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>

* Add NEWS entry for C domain bang fix

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2022-10-03 05:51:22 +02:00
Koki Saito 19ca114645
gh-96819: multiprocessing.resource_tracker: check if length of pipe write <= 512 (#96890)
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
2022-10-02 17:41:01 -07:00
Koki Saito 14d4f68ebb
gh-97706: multiprocessing tests: Delete unused variable `rand` (#97707) 2022-10-02 17:37:36 -07:00
Kumar Aditya 9151bbefea
GH-85447: Clarify docs about awaiting future multiple times (#97738) 2022-10-02 15:16:51 -07:00
Vinay Sajip cac2e8a51f
[docs] Update logging cookbook with recipe for using a logger like an output… (GH-97730) 2022-10-02 14:26:14 +01:00
C.A.M. Gerlach e8165d47b8
gh-97607: Fix content parsing in the impl-detail reST directive (#97652)
* Don't parse content as arg in the impl-detail directive

This does not change the (untranslated) output,
but ensures that the doctree node metadata is correct.
which fixes gh-97607 with the text not being translated.
It also simplifies the code and logic
and makes it consistant with the docutils built-in directives.

* Remove unused branch from impl-detail directive handling no-content case

This is not used anywhere in the docs and lacks a clear use case,
and is more likely a mistake which is now flagged at build time.
This simplifies the logic from two code paths to one,
and makes the behavior consistant with similar built-in directives
(e.g. the various admonition types).

* Further simplify impl-detail reST directive code
2022-10-02 07:20:17 +02:00
C.A.M. Gerlach dcc82331c8
gh-95975: Move except/*/finally ref labels to more precise locations (#95976)
* gh-95975: Move except/*/finally ref labels to more precise locations

* Add section headers to fix :keyword: role and aid navigation

* Move see also to the introduction rather than a particular subsection

* Fix other minor Sphinx syntax issues with except

Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>

* Suppress redundant link to same section for except too

* Don't link try/except/else/finally keywords if in the same section

* Format try/except/finally as keywords in modified sections

Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
2022-10-02 07:12:56 +02:00
Ofey Chan d639438609
gh-97591: In `Exception.__setstate__()` acquire strong references before calling `tp_hash` slot (#97700) 2022-10-01 20:57:17 -07:00
Gregory P. Smith 8baef8ae36
gh-95588: Drop the safety claim from `ast.literal_eval` docs. (#95919)
It was never really safe and this claim conflicts directly with the big warning in the docs about it being able to crash the interpreter.
2022-10-01 17:55:40 -07:00
Will Hawkins bd7d0e875e
Fix capitalization of Unix in documentation (#96913) 2022-10-01 16:41:06 -07:00
Łukasz Langa f00645d5db
gh-90908: Document asyncio.Task.cancelling() and asyncio.Task.uncancel() (#95253)
Co-authored-by: Thomas Grainger <tagrain@gmail.com>
2022-10-01 10:42:36 -07:00
Eric Snow 273a819ed2
gh-90110: Update the c-analyzer Tool (gh-97695)
https://github.com/python/cpython/issues/90110
2022-09-30 19:32:46 -06:00
Guido van Rossum 63780f4599
GH-97592: Fix crash in C remove_done_callback due to evil code (#97660)
Evil code could cause fut_callbacks to be cleared when PyObject_RichCompareBool is called.
2022-09-30 12:57:09 -07:00
Guido van Rossum e9d63760fe
GH-96827: Don't touch closed loops from executor threads (#96837)
* When chaining futures, skip callback if loop closed.
* When shutting down an executor, don't wake a closed loop.
2022-09-30 12:55:40 -07:00
Gregory P. Smith b05dd79649
gh-87597: Document TimeoutExpired.stdout & .stderr types (#97685)
This documents the behavior that has always been the case since timeout
support was introduced in Python 3.3.
2022-09-30 10:45:47 -07:00
Cheryl Sabella 1cc308d03c
bpo-35675: IDLE - separate config_key window and frame (#11427)
bpo-35598: IDLE: Refactor window and frame class

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2022-09-30 12:44:44 -04:00
Victor Stinner 9f2f1dd131
gh-94526: getpath_dirname() no longer encodes the path (#97645)
Fix the Python path configuration used to initialized sys.path at
Python startup. Paths are no longer encoded to UTF-8/strict to avoid
encoding errors if it contains surrogate characters (bytes paths are
decoded with the surrogateescape error handler).

getpath_basename() and getpath_dirname() functions no longer encode
the path to UTF-8/strict, but work directly on Unicode strings. These
functions now use PyUnicode_FindChar() and PyUnicode_Substring() on
the Unicode path, rather than strrchr() on the encoded bytes string.
2022-09-30 14:58:30 +02:00
Steve Dower ff54dd96cb
gh-90989: Install Windows launcher per-user, and clarify some installer text (GH-97655) 2022-09-30 10:29:31 +01:00
Steve Dower 73942e475c
gh-97649: The Tools directory is no longer installed on Windows (GH-97653) 2022-09-30 10:25:00 +01:00
Eddie Hebert 86a3be207d
Use SyntaxError invalid range in tutorial introduction example (GH-93031)
Use output from a 3.10+ REPL, showing invalid range, for the
SyntaxError examples in the tutorial introduction page.

Automerge-Triggered-By: GH:iritkatriel
2022-09-30 01:59:46 -07:00
Ofey Chan 83a3de4e06
gh-96348: Deprecate the 3-arg signature of coroutine.throw and generator.throw (GH-96428) 2022-09-30 09:43:02 +01:00
Jeff Allen 9a11ed8e50
gh-96397: Document that attributes need not be identifiers (#96454)
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
2022-09-29 16:02:27 -07:00
NoSuck 0179a82caa
closes gh-97650: correct sphinx executable (gh-97651) 2022-09-29 15:53:41 -07:00
Shin-myoung-serp 4652093e1b
gh-91212: Fixed flickering when the tracer is turned off (#95129)
Fixed flickering when the tracer is turned off.
2022-09-28 23:40:51 -07:00
Stanley c759944f16
gh-52597: Add position-only markers for os functions (#94735) 2022-09-28 18:06:50 -07:00
Victor Stinner 83a0f44ffd
gh-97612: Fix shell injection in get-remote-certificate.py (#97613)
Fix a shell code injection vulnerability in the
get-remote-certificate.py example script. The script no longer uses a
shell to run "openssl" commands. Issue reported and initial fix by
Caleb Shortt.

Remove the Windows code path to send "quit" on stdin to the "openssl
s_client" command: use DEVNULL on all platforms instead.

Co-authored-by: Caleb Shortt <caleb@rgauge.com>
2022-09-29 01:17:27 +02:00
Victor Stinner a5f092f3c4
gh-97616: list_resize() checks for integer overflow (#97617)
Fix multiplying a list by an integer (list *= int): detect the
integer overflow when the new allocated length is close to the
maximum size.  Issue reported by Jordan Limor.

list_resize() now checks for integer overflow before multiplying the
new allocated length by the list item size (sizeof(PyObject*)).
2022-09-29 00:07:07 +02:00
Jakob Weigert 81b9d9ddc2
Fix typo in error message in plistlib (GH-97540) 2022-09-28 20:46:09 +03:00
Kumar Aditya 575a253b5c
GH-82448: Add thread timeout for loop.shutdown_default_executor (#97561)
Co-authored-by: Kyle Stanley <aeros167@gmail.com>
2022-09-28 10:39:42 -07:00
Kumar Aditya 9a404b173e
fixup policy docs (#97618) 2022-09-28 10:34:49 -07:00
LiarPrincess 0c1d7a06ed
bpo-47243: Duplicate entry in 'Objects/unicodetype_db.h' (GH-32376)
Fix for duplicate 1st entry in 'Objects/unicodetype_db.h':

```c
/* a list of unique character type descriptors */
const _PyUnicode_TypeRecord _PyUnicode_TypeRecords[] = {
    {0, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 0}, <--- HERE
    {0, 0, 0, 0, 0, 32},
    {0, 0, 0, 0, 0, 48},
    …
```

https://bugs.python.org/issue47243

Automerge-Triggered-By: GH:isidentical
2022-09-28 06:57:14 -07:00
Vinay Sajip 5c110d1126
gh-65046: Add note about logging from async code. (GH-97602) 2022-09-28 05:17:42 +01:00
Andrew Kay d582edf0be
Fix docs on conditional expression grouping (GH-96447) 2022-09-27 21:57:32 -05:00
C.A.M. Gerlach cc0f3a10f0
gh-96377: Update asyncio policy doc intro paras to be clear and accurate (#97603)
Also fix up some cross-references in the asyncio docs.
2022-09-27 16:47:14 -07:00
Pablo Galindo Salgado aab01e3524
gh-96670: Raise SyntaxError when parsing NULL bytes (#97594) 2022-09-27 23:23:42 +01:00
Serhiy Storchaka dd53b79de0
gh-96959: Update more HTTP links (GH-97536)
Use HTTPS for documents which are available by both HTTP and HTTPS
links, but there is no redirection from HTTP to HTTPS or vice versa.
2022-09-27 14:08:11 +03:00
Serhiy Storchaka adbed2d542
gh-73588: Fix generation of the default name of tkinter.Checkbutton. (GH-97547)
Previously, checkbuttons in different parent widgets could have the same
short name and share the same state if arguments "name" and "variable" are
not specified. Now they are globally unique.
2022-09-27 14:05:05 +03:00
Cyker Way 68c46ae68b
gh-97545: Make Semaphore run faster. (#97549) 2022-09-26 16:38:00 -07:00
Kumar Aditya d68c37c0d0
GH-65046: Fix docs about logging in `asyncio` (#97559)
Explain that logging should not use network I/O.
2022-09-26 15:27:15 -07:00
Michael Curran d79dd929ac
bpo-38748: Add ctypes test for stack corruption due to misaligned arguments (GH-26204) 2022-09-26 17:27:44 +01:00