Commit Graph

26019 Commits

Author SHA1 Message Date
Gregory P. Smith 2eee9d9cd7
gh-99238: clarify the type of the env dict. (#99253) 2022-11-08 13:00:31 -08:00
Victor Stinner 4d5fcca273
gh-91248: Add PyFrame_GetVar() function (#95712)
Add PyFrame_GetVar() and PyFrame_GetVarString() functions to get a
frame variable by its name.

Move PyFrameObject C API tests from test_capi to test_frame.
2022-11-08 17:40:27 +01:00
Mikael Koli acf4d5d5bd
Fix broken link in `asyncio-subprocesses` doc (GH-99214)
# Fix broken link in Doc/library/asyncio-subprocess.rst

This is a trivial fix in documentation to fix a broken link.

There is a broken link in [Doc/library/asyncio-subprocess.rst](https://docs.python.org/3/library/asyncio-subprocess.html#asyncio.subprocess.Process) for the function ``wait_for``:

![image](https://user-images.githubusercontent.com/37690409/200388894-fb6b7c42-b2cc-49ec-a239-e3472890db1f.png)

I suppose this refers to the function ``asyncio.wait_for`` which is not clear in the docs.

This PR fixes the link and the result looks like the following:

![image](https://user-images.githubusercontent.com/37690409/200389483-b4a92105-7d2c-4285-b0fc-78a6dc0be39c.png)

Automerge-Triggered-By: GH:AlexWaygood
2022-11-08 08:26:06 -08:00
Nikita Sobolev e56e33d271
gh-72719: Remove asyncore and asynchat modules (#96580)
Remove modules asyncore and asynchat, which were deprecated by PEP 594.

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2022-11-08 16:48:58 +01:00
Kamil Turek b9dedfe61d
gh-92119: ctypes: Print exception class name instead of its representation (#98302) 2022-11-07 20:53:59 -08:00
Petr Viktorin 1438b77997
gh-96746: Docs: Clear up Py_TPFLAGS_DISALLOW_INSTANTIATION inheritance (GH-99002)
The flag is not inherited, but its effect -- a NULL tp_new -- is.

Drop hints for people who come here wanting to “disallow instantiation”.
2022-11-07 19:45:50 +01:00
Noam Cohen 80c08d1cd6
gh-95389: expose popular ETHERTYPE_* constants in the socket module (#95390)
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
Co-authored-by: CAM Gerlach <CAM.Gerlach@Gerlach.CAM>
2022-11-07 15:27:37 +01:00
Pablo Galindo Salgado 6168e714be
gh-98254: Add what's new entry for the improvement in commit bb56dead33 (#99197) 2022-11-07 13:37:14 +00:00
Pablo Galindo Salgado be31ecf8b3
gh-91058: Add what's new entry for the improvement in commit 7cfbb49fcd (#99198) 2022-11-07 13:36:48 +00:00
Erlend E. Aasland e02f1e2df9
Docs: add argument spec to sqlite3 CLI docs (#99200) 2022-11-07 14:18:36 +01:00
jmcb 728e42fcf5
doc: Formatting and typo fixes (#98974) 2022-11-06 20:55:55 -08:00
Wenzel Jakob 57a405213c
gh-98586: Add What's New entry and update docs (#99056)
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2022-11-06 23:54:55 +01:00
Nouran Ali 2db55e0c00
gh-94286 Fix documentation of print default param (GH-94297) 2022-11-06 20:14:58 +00:00
Pablo Galindo Salgado 99e2e60cb2
gh-99139: Improve NameError error suggestion for instances (#99140) 2022-11-06 13:52:06 +00:00
Ethan Furman 8feb7ab77c
gh-93464: [Enum] fix auto() failure during multiple assignment (GH-99148)
* fix auto() failure during multiple assignment

i.e. `ONE = auto(), 'text'` will now have `ONE' with the value of `(1,
'text')`.  Before it would have been `(<an auto instance>, 'text')`
2022-11-05 18:01:08 -07:00
Doj 586b07e1f9
[doc] fix typo (GH-99143) 2022-11-05 21:03:29 +00:00
Skip Montanaro c0bf7607a1
minor edits to locale doc (#98537) 2022-11-04 06:02:11 -07:00
Michael Droettboom 2844aa6a8e
Support comparing two sets of pystats (GH-98816)
This adds support for comparing pystats collected from two different builds.

- The `--json-output` can be used to load in a set of raw stats and output a
  JSON file.
- Two of these JSON files can be provided on the next run, and then comparative
  results between the two are output.
2022-11-04 10:15:54 +00:00
Nick Pope 016c7d37b6
Docs: add `named` to the list of styles in the sqlite3.paramstyle attr docs (#99078) 2022-11-04 00:21:01 +01:00
Victor Stinner 0faa0ba240
gh-92584: Remove the distutils package (#99061)
Remove the distutils package. It was deprecated in Python 3.10 by PEP
632 "Deprecate distutils module". For projects still using distutils
and cannot be updated to something else, the setuptools project can
be installed: it still provides distutils.

* Remove Lib/distutils/ directory
* Remove test_distutils
* Remove references to distutils
* Skip test_check_c_globals and test_peg_generator since they use
  distutils
2022-11-03 19:27:27 +01:00
Victor Stinner ef0e72b31d
gh-94172: Remove keyfile, certfile and check_hostname parameters (#94173)
Remove the keyfile, certfile and check_hostname parameters,
deprecated since Python 3.6, in modules: ftplib, http.client,
imaplib, poplib and smtplib. Use the context parameter (ssl_context
in imaplib) instead.

Parameters following the removed parameters become keyword-only
parameters.

ftplib: Remove the FTP_TLS.ssl_version class attribute: use the
context parameter instead.
2022-11-03 18:32:25 +01:00
Johnny11502 00b6745f16
gh-97909: PyMemberDef & PyGetSetDef members are not marked up (GH-98810) 2022-11-03 17:57:30 +01:00
Victor Stinner a60ddd31be
gh-98401: Invalid escape sequences emits SyntaxWarning (#99011)
A backslash-character pair that is not a valid escape sequence now
generates a SyntaxWarning, instead of DeprecationWarning.  For
example, re.compile("\d+\.\d+") now emits a SyntaxWarning ("\d" is an
invalid escape sequence), use raw strings for regular expression:
re.compile(r"\d+\.\d+"). In a future Python version, SyntaxError will
eventually be raised, instead of SyntaxWarning.

Octal escapes with value larger than 0o377 (ex: "\477"), deprecated
in Python 3.11, now produce a SyntaxWarning, instead of
DeprecationWarning. In a future Python version they will be
eventually a SyntaxError.

codecs.escape_decode() and codecs.unicode_escape_decode() are left
unchanged: they still emit DeprecationWarning.

* The parser only emits SyntaxWarning for Python 3.12 (feature
  version), and still emits DeprecationWarning on older Python
  versions.
* Fix SyntaxWarning by using raw strings in Tools/c-analyzer/ and
  wasm_build.py.
2022-11-03 17:53:25 +01:00
Victor Stinner cff1c20667
gh-94199: Remove ssl.wrap_socket() documentation (#99023)
The function has been removed. In the ssl documentation, replace
references to the ssl.wrap_socket() function with references to the
ssl.SSLContext.wrap_socket() method.

Co-authored-by: Illia Volochii <illia.volochii@gmail.com>
2022-11-03 13:33:33 +01:00
Mark Shannon f4adb97506
GH-96793: Implement PEP 479 in bytecode. (GH-99006)
* Handle converting StopIteration to RuntimeError in bytecode.

* Add custom instruction for converting StopIteration into RuntimeError.
2022-11-03 11:38:51 +00:00
Serhiy Storchaka e9ac890c02
gh-98740: Fix validation of conditional expressions in RE (GH-98764)
In very rare circumstances the JUMP opcode could be confused with the
argument of the opcode in the "then" part which doesn't end with the
JUMP opcode. This led to incorrect detection of the final JUMP opcode
and incorrect calculation of the size of the subexpression.

NOTE: Changed return value of functions _validate_inner() and
_validate_charset() in Modules/_sre/sre.c.  Now they return 0 on success,
-1 on failure, and 1 if the last op is JUMP (which usually is a failure).
Previously they returned 1 on success and 0 on failure.
2022-11-03 09:23:46 +02:00
Hugo van Kemenade 26720fffd0
Docs: Add 'as, match statement' to the index (#99001) 2022-11-02 19:15:00 -07:00
Skip Montanaro 1fd20d0b57
argparse howto: Use f-string in preference to "...".format() (#98883) 2022-11-02 19:08:08 -07:00
Pablo Galindo Salgado c053284e39
gh-96997: Clarify the contract of PyMem_SetAllocator() (#98977) 2022-11-02 21:49:12 +00:00
Stanley 0689b99bb8
gh-96265: Formatting changes for faq/programming (#98242)
* Formatting changes for faq/programming

* Add missing method formatting, use non-literal formatting

* Fix sphinx warnings

* Some extra formatting missed earlier

* More formatting suggestions from review

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>

* Add missing colon, avoid referening external module

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
2022-11-01 21:58:44 -07:00
Oleg Iarygin 898d0d9ad8
gh-92679: Clarify asyncio.loop.start_tls parameters (#92682) 2022-11-01 21:52:19 -07:00
Sebastian Rittau 65d1407737
gh-92871: Postpone the removal of typing.{io,re} to 3.13 (#98958) 2022-11-01 20:51:45 -07:00
Vinay Sajip 50a9b037a6
[doc] Update cookbook example for socket-based logging in a production sett… (GH-98922)
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
2022-11-01 23:00:17 +00:00
Manuel Kaufmann f042646595
Doc: use "unnumbered" footnotes (#98954)
Use unnumbered footnote in this file to avoid reseting the footnotes numbering.

Example: when building the tutorial into a PDF and using `latex_show_urls = "footnotes"`; this footnote become the number 8. However, without this change, the footnote shows the number 1.
2022-11-01 13:25:33 +00:00
Pablo Galindo Salgado 395d4285bf
gh-98931: Improve error message when the user types 'import x from y' instead of 'from y import x' (#98932) 2022-11-01 13:01:20 +00:00
Jelle Zijlstra 5cf317ade1
gh-98658: Add __class_getitem__ to array.array (#98661)
Closes #98658
2022-10-31 21:10:18 -07:00
partev f4d56292e9
Fix wording in Functional Programming HOWTO (GH-98939) 2022-10-31 21:49:27 -05:00
Manuel Kaufmann d22bde983e
Missing PS1 prompt in tutorial example (GH-98921) 2022-10-31 21:24:26 -05:00
Steve Dower 88297e2a8a
gh-98692: Enable treating shebang lines as executables in py.exe launcher (GH-98732) 2022-10-31 21:05:50 +00:00
partev 3b86538661
Fix typo in sorting HOWTO (#98888) 2022-10-31 12:58:13 -05:00
Julien Palard c1c3be0f9d
Doc: Fix sphinx-lint issues (GH-98911)
They were introduced right between GH-98441 and GH-98408.
2022-10-31 16:30:29 +01:00
Shantanu 880bafc574
gh-98576: Fix types in dataclass.InitVar example (gh-98577) 2022-10-31 11:02:02 -04:00
David Hewitt e98923c0be
gh-98410: move getbufferproc and releasebufferproc to buffer.h (#31158)
This adds them to the Limited API.
2022-10-31 15:01:32 +01:00
Jason R. Coombs 018b2483c4
gh-97966: Update uname docs to clarify the special nature of the platform attribute and to indicate when it became late-bound. (#97972) 2022-10-30 11:53:58 -04:00
ab fc94d55ff4
glossary.rst: Fix typo in package definition (GH-98865)
This is a tiny typo fix of package definition in glossary. 
According to https://devguide.python.org/documentation/help-documenting/ simple typos don’t require issues of their own, but, instead, a pull request can by submitted directly.

Automerge-Triggered-By: GH:AlexWaygood
2022-10-29 15:42:59 -07:00
Yuvi Panda bfecff5f73
Fix typo in docs (GH-98863) 2022-10-29 15:44:06 -05:00
Erlend E. Aasland e063c23c65
gh-93358: Fix python-config docs for how to embed Python (#98649) 2022-10-29 20:46:34 +02:00
FC Stegerman d10c2b9742
dataclasses docs: consistent indentation (4 spaces) in examples (#98855) 2022-10-29 18:06:52 +01:00
Mateusz 0023f51deb
gh-98240: Updated Path.rename docs, when it is atomic (GH-98245) 2022-10-28 16:31:37 -07:00
domragusa e089f23bbb
gh-84538: add strict argument to pathlib.PurePath.relative_to (GH-19813)
By default, :meth:`pathlib.PurePath.relative_to` doesn't deal with paths that are not a direct prefix of the other, raising an exception in that instance. This change adds a *walk_up* parameter that can be set to allow for using ``..`` to calculate the relative path.

example:
```
>>> p = PurePosixPath('/etc/passwd')
>>> p.relative_to('/etc')
PurePosixPath('passwd')
>>> p.relative_to('/usr')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "pathlib.py", line 940, in relative_to
    raise ValueError(error_message.format(str(self), str(formatted)))
ValueError: '/etc/passwd' does not start with '/usr'
>>> p.relative_to('/usr', strict=False)
PurePosixPath('../etc/passwd')
```


https://bugs.python.org/issue40358

Automerge-Triggered-By: GH:brettcannon
2022-10-28 16:20:14 -07:00