Commit Graph

112910 Commits

Author SHA1 Message Date
Brett Cannon cd29bd13ef
bpo-47061: deprecate cgi and cgitb (GH-32410)
Part of PEP 594.
2022-04-08 17:15:35 -07:00
Alexey Izbyshev 1c8b3b5d66
bpo-47260: Fix os.closerange() potentially being a no-op in a seccomp sandbox (GH-32418)
_Py_closerange() currently assumes that close_range() closes
all file descriptors even if it returns an error (other than ENOSYS).
This assumption can be wrong on Linux if a seccomp sandbox denies
the underlying syscall, pretending that it returns EPERM or EACCES.
In this case _Py_closerange() won't close any descriptors at all,
which in the worst case can be a security issue.

Fix this by falling back to other methods in case of any close_range()
error. Note that fallbacks will not be triggered on any problems with
closing individual file descriptors because close_range() is documented
to ignore such errors on both Linux[1] and FreeBSD[2].

[1] https://man7.org/linux/man-pages/man2/close_range.2.html
[2] https://www.freebsd.org/cgi/man.cgi?query=close_range&sektion=2
2022-04-08 10:40:39 -07:00
Raymond Hettinger d6fb104690
Fix bad grammar and import docstring for split/rsplit (GH-32381) 2022-04-08 08:36:20 -05:00
Petr Viktorin 1c2fddddae
Add feature macro PY_HAVE_THREAD_NATIVE_ID to the stable ABI definition (GH-32365) 2022-04-08 14:35:11 +02:00
Mark Shannon 5b4a4b6f09
Add new PyFrame_GetLasti C-API function (GH-32413) 2022-04-08 12:18:57 +01:00
Raymond Hettinger f4b328e2bb
Clarify that this sentence applies to the above example. GH-32405 2022-04-07 21:10:00 -05:00
Dong-hee Na e2d78baed3
bpo-47250: Fix refleak from object.__getstate__() (GH-32403)
Co-authored-by: Brandt Bucher <brandt@python.org>
2022-04-08 08:27:00 +09:00
Brandt Bucher ef6a482b02
bpo-47177: Replace `f_lasti` with `prev_instr` (GH-32208) 2022-04-07 12:31:01 -07:00
Brett Cannon 87eec70d97
Deprecate audioop (GH-32392) 2022-04-07 12:27:35 -07:00
CAM Gerlach 1df4298b62
Doc: Fix spurious comma in the author metadata field (GH-32386)
Signed-off-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
2022-04-07 14:27:14 -04:00
Frederick 9ee2d3a939
ssl docs: Fix typo (GH-32336) 2022-04-07 09:29:23 -07:00
Jelle Zijlstra 4c92427fb8
c-api docs: There are five fields, not four (GH-32379) 2022-04-07 07:02:54 -07:00
Christian Heimes 2b16a08bc7
bpo-40280: Detect missing threading on WASM platforms (GH-32352)
Co-authored-by: Brett Cannon <brett@python.org>
2022-04-07 09:22:47 +02:00
Raymond Hettinger 5aee46b31b
Remove micro-optimization that no longer shows a benefit. (GH-32397) 2022-04-06 22:00:47 -05:00
Géry Ogam 1d0f08fa46
pickle docs: Fix typos and improve wording (GH-24776)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2022-04-06 18:38:35 -07:00
Eric Wieser b786d9ec52
doc: Link to `string.capwords` from `str.title` (GH-20913)
Since `title()` mentions its own short-comings, it should also mention the library function which does not possess them.

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2022-04-06 18:31:39 -07:00
Frederick 1da9c38fd3
ssl docs: Fix typo (GH-32314) 2022-04-06 17:51:35 -07:00
Boris Verkhovskiy 63bd72448a
pkgutil docs: Link sys constants, add backticks (GH-32356)
Co-authored-by: Éric <merwok@netwok.org>
2022-04-06 17:51:05 -07:00
Victor Stinner 85addfb9c6
bpo-35134: Remove the Include/code.h header file (GH-32385)
Remove the Include/code.h header file. C extensions should only
include the main <Python.h> header file.

Python.h includes directly Include/cpython/code.h instead.
2022-04-07 02:29:52 +02:00
Victor Stinner 5c4d1f6e0e
bpo-35134: Add Include/cpython/setobject.h header (GH-32384) 2022-04-07 01:26:24 +02:00
Steve Dower 2390b2236d
bpo-47239: Fixes py.exe output when run in a virtual environment. (GH-32364) 2022-04-07 00:09:54 +01:00
Victor Stinner ca219f6dfc
bpo-35134: Add Include/cpython/complexobject.h header (GH-32383)
Move the private _PyComplex_FormatAdvancedWriter() function to the
internal C API. This function is no longer exported.
2022-04-07 01:05:27 +02:00
Jeremy Kloth 612e422c6e
bpo-46576: Speed up test_peg_generator by using a static library for shared sources (GH-32338)
Speed up test_peg_generator by using a static library for shared sources to avoid recompiling as much code.
2022-04-06 14:55:58 -07:00
Raymond Hettinger 1ba82d4419
Change parameter name from *x* for reals to *n* for integers. (GH-32377) 2022-04-06 14:35:05 -05:00
Brett Cannon 32b33879c2
bpo-47061: use `warnings._deprecated()` with asynchat, asyncore, and smtpd (GH-32350) 2022-04-06 11:22:39 -07:00
Géry Ogam 59a99ae277
Minor code nit: Move an unrelated statement out of a try clause in Sequence.index (GH-32330) 2022-04-06 13:03:36 -05:00
Serhiy Storchaka 884eba3c76
bpo-26579: Add object.__getstate__(). (GH-2821)
Copying and pickling instances of subclasses of builtin types
bytearray, set, frozenset, collections.OrderedDict, collections.deque,
weakref.WeakSet, and datetime.tzinfo now copies and pickles instance attributes
implemented as slots.
2022-04-06 20:00:14 +03:00
Mathieu Dupuy f82f9ce323
Remove python2 support in logging cookbook example. (GH-32362) 2022-04-06 17:57:54 +01:00
Serhiy Storchaka a69a4a917c
bpo-46721: Optimize set.issuperset() for non-set arguments (GH-31280) 2022-04-06 19:57:13 +03:00
Serhiy Storchaka 31cd25f4e1
bpo-43464: Optimize set.intersection() for non-set arguments (GH-31316) 2022-04-06 19:56:28 +03:00
Serhiy Storchaka 50872dbadc
bpo-47227: Suppress expression chaining for more RE parsing errors (GH-32333) 2022-04-06 19:54:44 +03:00
Serhiy Storchaka b09184bf05
bpo-47211: Remove function re.template() and flag re.TEMPLATE (GH-32300)
They were undocumented and never working.
2022-04-06 19:53:50 +03:00
Ken Jin da922409ac
Fix whitespace/indentation issues in test_sys (GH-32369) 2022-04-06 23:40:51 +08:00
Ian b33c4564ac
stdtypes docs: fix typo (GH-32349) 2022-04-06 08:39:17 -07:00
Gregory P. Smith ac1fb07b6e
bpo-47235: Note where a typo is intentional in code. (GH-32348)
People keep popping up reporting these as typos in the docs despite
being described as typos in the surrounding text.  Hopefully a comment
on the line itself makes it more obvious?

Arguably some of the typo examples are not using the "right" typo as the
"assret" one in particular is now detected by default due to how common
it was in actual code.  But I don't want to to typo chasing by changing
these examples to be other not yet auto-detected typos as they still
illustrate the point well enough.
2022-04-06 08:06:58 -07:00
Petr Viktorin d79f118d04
bpo-47115: Document which parts of structs are in limited API/stable ABI (GH-32196)
Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
2022-04-06 16:50:45 +02:00
Victor Stinner 14a9b4895b
bpo-40421: test_capi uses assertEqual(), not assertEquals() (GH-32361)
unittest.TestCase.assertEquals() alias is depracated. Fix the
warning:

Lib/test/test_capi.py:1100: DeprecationWarning: Please use assertEqual instead.
  self.assertEquals(frame.f_locals, _testcapi.frame_getlocals(frame))
2022-04-06 15:12:38 +02:00
Christian Heimes 765f6dee0f
bpo-40280: WASM defaults to no dynamic linking (GH-32360) 2022-04-06 14:33:31 +02:00
Victor Stinner 2b4f2f5fa4
Revert "bpo-46850: Move _PyEval_EvalFrameDefault() to internal C API (GH-32052)" (GH-32343)
* Revert "bpo-46850: Move _PyInterpreterState_SetEvalFrameFunc() to internal C API (GH-32054)"

This reverts commit f877b40e3f.

* Revert "bpo-46850: Move _PyEval_EvalFrameDefault() to internal C API (GH-32052)"

This reverts commit b9a5522dd9.
2022-04-06 13:58:07 +02:00
Julien Palard 1d3e743599
[doc] Add missing backtick. (GH-32355) 2022-04-06 13:40:37 +02:00
Ken Jin 9ffe47df54
bpo-47189: What's New in 3.11: Faster CPython (GH-32235)
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Guido van Rossum <gvanrossum@users.noreply.github.com>
Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2022-04-06 19:38:25 +08:00
Steve Dower 074da78802
bpo-47103: Copy pgort140.dll into output directory when building PGInstrument on Windows (GH-32083) 2022-04-06 11:56:31 +01:00
Steve Dower 35bcf9f3c1
Fix generation of MD5 table at end of Windows release build (GH-32345) 2022-04-06 11:55:47 +01:00
Pablo Galindo a96dfbdc3e
Post 3.11.0a7 2022-04-05 21:10:38 +01:00
Pablo Galindo 2e49bd06c5
Python 3.11.0a7 2022-04-05 20:54:03 +01:00
Brett Cannon c1d93b6411
bpo-47061: deprecate the `aifc` module (GH-32134)
Co-authored-by: Christian Heimes <christian@python.org>
2022-04-05 12:05:48 -07:00
Jeremy Kloth 944f09adfc
bpo-47230: Silence compiler warnings on Windows from zlib 1.2.12 (GH-32337) 2022-04-05 20:03:17 +01:00
Sam Ezeh 050a8f94c6
bpo-4833: Add ZipFile.mkdir (GH-32160) 2022-04-05 11:41:38 -07:00
Christian Heimes 9e88b572fb
bpo-47009: Fix assert on big endian (GH-32332) 2022-04-05 18:18:02 +02:00
Hugo van Kemenade 75280944e5
bpo-46607: Add DeprecationWarning for LegacyInterpolation, deprecated in docs since 3.2 (GH-30927) 2022-04-05 08:15:11 -07:00