Terry Jan Reedy
3e45030076
gh-116563: Update tutorial error example ( #116569 )
...
There now may be multiple carets pointing at a token
rather than just a character. Fix the sentence about
possible causes.
2024-03-11 18:01:08 -04:00
Pierre Ossman (ThinLinc team)
1d0d49a7e8
gh-113538: Add asycio.Server.{close,abort}_clients ( #114432 )
...
These give applications the option of more forcefully terminating client
connections for asyncio servers. Useful when terminating a service and
there is limited time to wait for clients to finish up their work.
2024-03-11 12:43:30 -07:00
Malcolm Smith
872c0714fc
gh-71052: Change Android's `sys.platform` from "linux" to "android"
...
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2024-03-11 19:25:39 +00:00
Brett Simmers
2731913dd5
gh-116167: Allow disabling the GIL with `PYTHON_GIL=0` or `-X gil=0` ( #116338 )
...
In free-threaded builds, running with `PYTHON_GIL=0` will now disable the
GIL. Follow-up issues track work to re-enable the GIL when loading an
incompatible extension, and to disable the GIL by default.
In order to support re-enabling the GIL at runtime, all GIL-related data
structures are initialized as usual, and disabling the GIL simply sets a flag
that causes `take_gil()` and `drop_gil()` to return early.
2024-03-11 11:02:58 -04:00
Declan
db8f423f58
gh-116535: Fix distracting "TypeError" in example code (gh-116538)
2024-03-09 16:52:57 -05:00
Sergey B Kirpichev
1e68c4b876
gh-111389: expose PyHASH_INF/BITS/MODULUS/IMAG macros as public ( #111418 )
...
Co-authored-by: Victor Stinner <vstinner@python.org>
2024-03-09 21:32:05 +01:00
Kerim Kabirov
03f86b1b62
GH-116218 Docs: Add availability information for the 'resource' module ( #116256 )
...
Add availability data to 'resource' module Docs
2024-03-09 10:00:37 +01:00
Nicolas A. Oyarzabal
601f3a7b33
gh-105535 Document potential performance trap during enum creation (GH-107119)
...
Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-03-08 11:22:17 -08:00
infohash
735fc2cbbc
gh-75988: Fix issues with autospec ignoring wrapped object ( #115223 )
...
* set default return value of functional types as _mock_return_value
* added test of wrapping child attributes
* added backward compatibility with explicit return
* added docs on the order of precedence
* added test to check default return_value
2024-03-08 19:14:32 +00:00
Nikita Sobolev
0b647141d5
gh-116349: Deprecate `platform.java_ver` function ( #116471 )
...
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-03-08 11:14:17 +03:00
Skip Montanaro
d9ccde28c4
gh-106259: Add minimal help target to Makefile ( #106260 )
...
Co-authored-by: Erlend E. Aasland <erlend@python.org>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2024-03-07 18:21:28 +01:00
Serhiy Storchaka
808a77612f
gh-115664: Fix ordering of more versionadded and versionchanged directives (GH-116298)
2024-03-07 10:05:03 +02:00
William Woodruff
0876b921b2
gh-107361: strengthen default SSL context flags ( #112389 )
...
This adds `VERIFY_X509_STRICT` to make the default
SSL context perform stricter (per RFC 5280) validation, as well
as `VERIFY_X509_PARTIAL_CHAIN` to enforce more standards-compliant
path-building behavior.
As part of this changeset, I had to tweak `make_ssl_certs.py`
slightly to emit 5280-conforming CA certs. This changeset includes
the regenerated certificates after that change.
Signed-off-by: William Woodruff <william@yossarian.net>
Co-authored-by: Victor Stinner <vstinner@python.org>
2024-03-06 13:44:58 -08:00
Jason Zhang
ce0ae1d784
gh-115957: Close coroutine if TaskGroup.create_task() raises an error ( #116009 )
2024-03-06 12:20:26 -08:00
Sebastian Pipping
73807eb634
gh-115398: Suggest use of `hasattr` with checking for 3.13 Expat API availability (GH-116278)
...
Suggest use of "hasattr" with checking for 3.13 Expat API availability
2024-03-06 11:08:25 -08:00
Prince Roshan
e800265aa1
gh-107625: configparser: Raise error if a missing value is continued (GH-107651)
...
Co-authored-by: Éric <merwok@netwok.org>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
2024-03-06 14:05:54 +00:00
Kerim Kabirov
e205c5cd8f
gh-115986: Fix inaccuracies in pprint docs ( #116104 )
...
Amend wording after gh-116019 was merged.
2024-03-05 22:14:52 +01:00
cui fliter
e7ba6e9dbe
chore: fix typos ( #116345 )
...
Signed-off-by: cui fliter <imcusg@gmail.com>
2024-03-05 09:05:52 -07:00
Serhiy Storchaka
df59401108
Fix the PyGetSetDef documentation (GH-116056)
...
closure is not a function pointer, it is a user data pointer.
2024-03-05 17:48:20 +02:00
Serhiy Storchaka
0064dfa091
gh-115777: Fix double versionadded directives (GH-116269)
2024-03-05 17:41:53 +02:00
Tobias Rautenkranz
60743a9a7e
gh-57141: Add dircmp shallow option (GH-109499)
...
Co-authored-by: Steve Ward <planet36@gmail.com>
Co-authored-by: Sanyam Khurana <8039608+CuriousLearner@users.noreply.github.com>
2024-03-04 17:27:43 +00:00
Raymond Hettinger
15dc2979bc
Consistently spell out *predicate* instead of *pred*. (gh-116308)
2024-03-04 15:51:29 +00:00
pan324
0dfa7ce346
gh-115256: Remove refcycles from tarfile writing (GH-115257)
2024-03-04 13:26:32 +00:00
Kerim Kabirov
45a92436c5
GH-116271 Docs: provide clarification for object assignments in the Tutorial section ( #116283 )
...
Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-03-04 12:22:13 +00:00
Iman Tabrizian
3383d6afa3
gh-116010: Remove link to deprecated PEP 6 in FAQ guide ( #116246 )
...
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-03-03 12:50:18 -07:00
HarryLHW
4859ecb860
gh-116281: Remove wrong '\' from '\*' in some doc signatures ( #116282 )
2024-03-03 14:32:32 -05:00
Hugo van Kemenade
4d3ee77aef
Docs: update using/configure.rst ( #116274 )
2024-03-03 08:40:02 -07:00
Gouvernathor
67f742e03a
gh-72971: Clarify the special no-TypeError behavior for equality ( #110729 )
2024-03-03 00:45:48 +00:00
AN Long
dac8ff4c40
gh-104711: Add security warning to the CGIHTTPRequestHandler document (GH-115915)
2024-03-01 17:25:14 +00:00
Serhiy Storchaka
05b04903a1
gh-116035: Document that both tzinfo and fold are ignored in comparisons if tzinfo is the same (GH-116187)
...
This mostly restores information removed in c12240ed28
(GH-114749).
2024-03-01 19:16:29 +02:00
Gouvernathor
2713c2abc8
gh-104219: Document that idunders can return NotImplemented ( #104220 )
...
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2024-03-01 16:51:47 +01:00
Sebastian Pipping
6a95676bb5
gh-115398: Expose Expat >=2.6.0 reparse deferral API (CVE-2023-52425) (GH-115623)
...
Allow controlling Expat >=2.6.0 reparse deferral (CVE-2023-52425) by adding five new methods:
- `xml.etree.ElementTree.XMLParser.flush`
- `xml.etree.ElementTree.XMLPullParser.flush`
- `xml.parsers.expat.xmlparser.GetReparseDeferralEnabled`
- `xml.parsers.expat.xmlparser.SetReparseDeferralEnabled`
- `xml.sax.expatreader.ExpatParser.flush`
Based on the "flush" idea from https://github.com/python/cpython/pull/115138#issuecomment-1932444270 .
### Notes
- Please treat as a security fix related to CVE-2023-52425.
Includes code suggested-by: Snild Dolkow <snild@sony.com>
and by core dev Serhiy Storchaka.
2024-02-29 14:52:50 -08:00
Shantanu
c04a981ff4
Fix rendering of null character in ast.rst ( #116080 )
2024-02-29 14:09:06 -08:00
Carl Bordum Hansen
91c3c64237
gh-73580: Docs for tunnelling TLS through TLS (GH-22539)
2024-02-29 22:56:04 +02:00
Erlend E. Aasland
dbe44f150c
Docs: mark up NotImplemented using the :data: role throughout the docs ( #116135 )
2024-02-29 20:46:12 +00:00
Vinay Sajip
3b6f4cadf1
gh-115811: Update documentation to add some Logger attributes. (GH-116109)
2024-02-29 10:53:19 -08:00
Raymond Hettinger
a81d9509ee
Make the iter_except() recipe more compact. (gh-116132)
...
Only one example is needed
2024-02-29 11:30:18 -06:00
Shantanu
bea2795be2
gh-115881: Document feature_version limitations ( #115980 )
2024-02-29 11:09:09 +00:00
Erlend E. Aasland
fb2e17b642
gh-115937: Remove implementation details from inspect.signature() docs ( #116086 )
...
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2024-02-29 09:42:28 +00:00
Ethan Furman
3ea78fd5bc
gh-115821: [Enum] better error message for calling super().__new__() (GH-116063)
...
docs now state to not call super().__new__
if super().__new__ is called, a better error message is now used
2024-02-28 15:17:49 -08:00
Raymond Hettinger
f484a2a748
Update an out-of-date example in the itertools recipe intro (gh-116082)
2024-02-28 17:11:05 -06:00
Raymond Hettinger
67c19e57b5
Improve all_equal() recipe (gh-116081)
...
Replace conjuction of next() calls with simpler len()/take() logic. Add key function.
2024-02-28 17:04:56 -06:00
Kerim Kabirov
6c1c94dc51
GH-115986 Reorder pprint docs and amend some references ( #116019 )
...
Introduce a new subsubsection, 'Functions', for module level functions,
and place it before the PrettyPrinter class reference.
Also:
- Fix pprint.pprint() references so they properly link to the module
level function.
- Add links to sys.stdout.
2024-02-28 20:43:05 +01:00
Jan Max Meyer
647053fed1
doc: Use super() in subclassed JSONEncoder examples (GH-115565)
...
Replace calls to `json.JSONEncoder.default(self, obj)`
by `super().default(obj)` within the examples of the documentation.
2024-02-28 14:54:12 +01:00
Erlend E. Aasland
a71e32ce8e
gh-78612: Mark up eval() using param list ( #115212 )
...
Also mention that the 'expression' parameter can be a string.
2024-02-28 14:03:50 +01:00
Jelle Zijlstra
ed4dfd8825
gh-105858: Improve AST node constructors ( #105880 )
...
Demonstration:
>>> ast.FunctionDef.__annotations__
{'name': <class 'str'>, 'args': <class 'ast.arguments'>, 'body': list[ast.stmt], 'decorator_list': list[ast.expr], 'returns': ast.expr | None, 'type_comment': str | None, 'type_params': list[ast.type_param]}
>>> ast.FunctionDef()
<stdin>:1: DeprecationWarning: FunctionDef.__init__ missing 1 required positional argument: 'name'. This will become an error in Python 3.15.
<stdin>:1: DeprecationWarning: FunctionDef.__init__ missing 1 required positional argument: 'args'. This will become an error in Python 3.15.
<ast.FunctionDef object at 0x101959460>
>>> node = ast.FunctionDef(name="foo", args=ast.arguments())
>>> node.decorator_list
[]
>>> ast.FunctionDef(whatever="you want", name="x", args=ast.arguments())
<stdin>:1: DeprecationWarning: FunctionDef.__init__ got an unexpected keyword argument 'whatever'. Support for arbitrary keyword arguments is deprecated and will be removed in Python 3.15.
<ast.FunctionDef object at 0x1019581f0>
2024-02-27 18:13:03 -08:00
Tahoma Software
3a72fc36f9
gh-115315: Update time.rst to include microseconds field (%f) in chart ( #115316 )
...
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-02-27 15:33:05 +02:00
Phil Elson
37f5d06b1b
Doc: Clarify the return type of Event.wait when timeout is used (GH-104168)
2024-02-26 11:53:20 +02:00
Antti Haapala
915d7dd090
gh-115091: Remove a left-over sentence that refers to Py_OptimizeFlag from ctypes documentation (GH-115092)
...
Remove a left-over sentence that refers to Py_OptimizeFlag
Remove a left-over sentence that refers to an example that was present in Python 3.10 and was using ``Py_OptimizeFlag``.
2024-02-26 10:22:54 +01:00
Hugo van Kemenade
8e8ab75d97
gh-101100: Fix Sphinx warnings in `whatsnew/2.1.rst` ( #112357 )
...
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2024-02-25 23:49:04 -07:00