Commit graph

109437 commits

Author SHA1 Message Date
Serhiy Storchaka b1dc1aacf8
bpo-43084: Return bool instead of int from curses.window.enclose() (GH-24398) 2021-04-05 16:50:24 +03:00
Inada Naoki c8e5eb904e
bpo-43651: PEP 597: Fix EncodingWarning in some tests (GH-25181)
* Fix test_shutil
* Fix test_imp
* Fix test_import
* Fix test_importlib
2021-04-05 13:11:23 +09:00
Inada Naoki ee952b5c73
bpo-43651: PEP 597: Fix EncodingWarning in test_filecmp (GH-25159) 2021-04-05 12:32:35 +09:00
Inada Naoki de522a89e4
bpo-43651: PEP 597: Fix test_email (GH-25158) 2021-04-05 12:30:12 +09:00
Ken Jin 2b5913b4ee
bpo-41370: Add note about ForwardRefs and PEP585 generic types in docs (#25183) 2021-04-04 08:14:44 -07:00
Irit Katriel aadd4e10fd
bpo-24160: Fix test_pdb refleaks failure (GH-25182) 2021-04-04 16:04:53 +01:00
Dennis Sweeney c368ce74d2
bpo-27129: Update magic numbers and bootstrapping for GH-25069 (GH-25172)
* Update magic numbers and bootstrapping for GH-25069

* add blurb

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2021-04-04 09:33:22 +01:00
Inada Naoki 3caea9adda
bpo-43651: PEP 597: Fix EncodingWarning in some tests (GH-25171)
* Fix test_float
* Fix _osx_support
* Fix test_fstring
* Fix test_gc
* Fix test_gzip
* Fix test_hashlib
* Fix unrelated whitespace issue

Co-authored-by: Ned Deily <nad@python.org>
2021-04-04 17:01:10 +09:00
Raymond Hettinger f8775e4f72
bpo-43325: Add FAQ entry for identity tests (GH-25168) 2021-04-03 19:54:49 -07:00
Inada Naoki 35715d1e72
bpo-43651: PEP 597: Fix EncodingWarning in some tests (GH-25145)
* test_asyncio
* test_bz2
* test_math
* test_cmath
* test_cmd_line
* test_cmd_line_script
* test_compile
* test_contextlib
* test_profile
* ctypes/test/test_find
* test_multiprocessing
* test_configparser
* test_csv
* test_dbm_dumb
* test_decimal
* test_difflib
* os.fdopen() calls io.text_encoding() to emit EncodingWarning for right place.
2021-04-04 09:01:23 +09:00
Brett Cannon dc6d3e1e4c
bpo-43720: Update import-related stdlib deprecation messages to say they will be removed in Python 3.12 (GH-25167) 2021-04-03 15:31:15 -07:00
Raymond Hettinger c5354c045c
Replace broken example code with correct simpler code. (GH-25162)
The open() was missing 'w' to indicate it was in a write-mode.
Even then, the open().close() operation was distracting because
it is an unusual way to "touch" as file.  Using os.remove()
instead is simpler and less distracting.
2021-04-03 13:09:01 -07:00
Raymond Hettinger e4c8895ee5
Add more tests for the descriptor tutorial (GH-25164) 2021-04-03 13:07:52 -07:00
Ammar Askar b2a91e0c9e
bpo-43705: Document that SyntaxError's offsets are 1-indexed (GH-25153)
Changed the inline mentions of the attributes into a proper attribute list like `SystemExit` has.

Automerge-Triggered-By: GH:gvanrossum
2021-04-02 14:25:31 -07:00
Brett Cannon f97dc80068
bpo-43672: raise ImportWarning when calling find_loader() (GH-25119) 2021-04-02 12:35:32 -07:00
Irit Katriel ad442a674c
bpo-24160: Fix breakpoints persistence across multiple pdb sessions (GH-21989) 2021-04-02 09:15:21 -07:00
Zackery Spytz afd1265058
bpo-31956: Add start and stop parameters to array.index() (GH-25059)
Co-Authored-By: Anders Lorentsen <Phaqui@gmail.com>
2021-04-03 00:28:35 +09:00
Victor Stinner 240bcf82a1
bpo-41111: xxlimited.c defines Py_LIMITED_API (GH-25151)
xxlimited.c and xxlimited_35.c now define the Py_LIMITED_API macro,
rather than having to do it in the build recipe.

Co-authored-by: Hai Shi <shihai1992@gmail.com>
2021-04-02 16:48:11 +02:00
Victor Stinner 9bb5658bd1
bpo-43688: Support "make regen-limited-abi" in debug mode (GH-25133) 2021-04-02 16:46:08 +02:00
Victor Stinner 3359cab038
bpo-43688: Support the limited C API in debug mode (GH-25131)
The limited C API is now supported if Python is built in debug mode
(if the Py_DEBUG macro is defined). In the limited C API, the
Py_INCREF() and Py_DECREF() functions are now implemented as opaque
function calls, rather than accessing directly the PyObject.ob_refcnt
member, if Python is built in debug mode and the Py_LIMITED_API macro
targets Python 3.10 or newer. It became possible to support the
limited C API in debug mode because the PyObject structure is the
same in release and debug mode since Python 3.8 (see bpo-36465).

The limited C API is still not supported in the --with-trace-refs
special build (Py_TRACE_REFS macro).
2021-04-02 15:45:37 +02:00
Victor Stinner 442ad74fc2
bpo-43687: Py_Initialize() creates singletons earlier (GH-25147)
Reorganize pycore_interp_init() to initialize singletons before the
the first PyType_Ready() call. Fix an issue when Python is configured
using --without-doc-strings.
2021-04-02 15:28:13 +02:00
Mark Shannon 58384c6ab0
Document PyCode_Addr2Line function. (GH-25111)
* Document PyCode_Addr2Line function.

* Clarify when to use PEP 626 line iterators.
2021-04-02 13:24:57 +01:00
Inada Naoki bec8c787ec
bpo-43510: Fix emitting EncodingWarning from _io module. (GH-25146)
I forget to check PyErr_WarnEx() return value. But it will fail when -Werror is used.
2021-04-02 17:38:59 +09:00
Inada Naoki 8bbfeb3330
bpo-43651: PEP 597: Fix EncodingWarning in some tests (GH-25142)
* test__xxsubinterpreters
* test_builtin
* test_doctest
* test_exceptions
* test_opcodes
* test_support
* test_argparse
* test_baseexception
* test_bdb
* test_bool
* test_asdl_parser
2021-04-02 12:53:46 +09:00
Erlend Egeberg Aasland bef7b26f72
bpo-43700: Replace Zulip badge with Discourse badge (GH-25141)
Automerge-Triggered-By: GH:zware
2021-04-01 20:30:40 -07:00
Inada Naoki 80017752ba
bpo-43651: Fix test_compileall with PEP 597 (GH-25128) 2021-04-02 09:01:57 +09:00
Inada Naoki c0ec4486dc
bpo-43651: Fix EncodingWarning in lib2to3/pgen2/pgen.py (GH-25127) 2021-04-02 08:59:15 +09:00
Inada Naoki 036fc7de24
bpo-43651: Fix EncodingWarning in test_warnings (GH-25126) 2021-04-02 08:57:05 +09:00
Irit Katriel bd4ab8e739
bpo-26053: Fix test_pdb.test_issue26053() (GH-25139) 2021-04-01 21:05:51 +02:00
Zackery Spytz e689cdca3c
bpo-43677: Fix a minor error in Doc/howto/descriptor.rst (#25123)
It should be PyMethod_Type, not Py_MethodType.
2021-04-01 10:03:33 -07:00
Irit Katriel 652bfdee94
bpo-26053: Fix args echoed by pdb run command (#22033) 2021-04-01 08:25:59 -07:00
Mark Shannon fcb55c0037
bpo-27129: Use instruction offsets, not byte offsets, in bytecode and internally. (GH-25069)
* Use instruction offset, rather than bytecode offset. Streamlines interpreter dispatch a bit, and removes most EXTENDED_ARGs for jumps.

* Change some uses of PyCode_Addr2Line to PyFrame_GetLineNumber
2021-04-01 16:00:31 +01:00
Victor Stinner 2ac0515027
bpo-43688: Fix Py_LIMITED_API version of xxlimited (GH-25135)
xxlimited targets Python 3.10, not Python 3.16: fix the hexadecimal
version number used in the Py_LIMITED_API macro.
2021-04-01 15:09:33 +02:00
Victor Stinner 61092a99c4
bpo-43690: stable_abi.py no longer parses macros (GH-25136)
The stable_abi.py script no longer parse macros. Macro targets can be
static inline functions which are not part of the stable ABI, only
part of the limited C API.

Run "make regen-limited-abi" to exclude PyType_HasFeature from
Doc/data/stable_abi.dat.
2021-04-01 14:13:42 +02:00
Victor Stinner baf10da750
bpo-43688: Run make regen-limited-abi (GH-25134) 2021-04-01 11:29:46 +02:00
Don Kirkby 18701a0608
Fix typos in 3.10 "What's new" (GH-25104) 2021-04-01 15:00:30 +09:00
Tim Peters 078a3433eb
When printing stats, move radix tree info to its own section. (GH-25125)
When printing stats, move radix tree info to its own section.
Restore that the breakdown of bytes in arenas exactly accounts for the total of arena bytes allocated.
Add an assert so that invariant doesn't break again.
2021-03-31 22:46:31 -05:00
Inada Naoki 58cffba187
bpo-43651: Fix EncodingWarning in test_io (GH-25097) 2021-04-01 11:25:04 +09:00
Inada Naoki 55f31be44b
bpo-43651: Fix EncodingWarning in test_file and test_file_eintr (GH-25109) 2021-04-01 11:23:03 +09:00
Victor Stinner ad493edf57
bpo-42955: Add _overlapped to sys.stdlib_module_names (GH-25122) 2021-04-01 02:28:23 +02:00
Ethan Furman 49aec1a185
Enum: add (re)import of Flag for doctests (GH-25118)
Fix issue with CI doctest forgetting that ``Flag`` had already been imported.
2021-03-31 09:20:08 -07:00
Julien Palard 202b546442
Disambiguate that -m also terminates the option list in the manpage. (GH-25100) 2021-03-31 14:31:38 +02:00
Victor Stinner f3ab670fea
bpo-37945: Fix test_locale.test_getsetlocale_issue1813() (#25110)
Skip the test if setlocale() fails.
2021-03-31 13:01:46 +02:00
Łukasz Langa 027d2cf1e5
Document GH-24624 2021-03-31 12:22:37 +02:00
Jessica Clarke dec0757549
bpo-43179: Generalise alignment for optimised string routines (GH-24624)
* Remove m68k-specific hack from ascii_decode

On m68k, alignments of primitives is more relaxed, with 4-byte and
8-byte types only requiring 2-byte alignment, thus using sizeof(size_t)
does not work. Instead, use the portable alternative.

Note that this is a minimal fix that only relaxes the assertion and the
condition for when to use the optimised version remains overly strict.
Such issues will be fixed tree-wide in the next commit.

NB: In C11 we could use _Alignof(size_t) instead, but for compatibility
we use autoconf.

* Optimise string routines for architectures with non-natural alignment

C only requires that sizeof(x) is a multiple of alignof(x), not that the
two are equal. Thus anywhere where we optimise based on alignment we
should be using alignof(x) not sizeof(x).

This is more annoying than it would be in C11 where we could just use
_Alignof(x) (and alignof(x) in C++11), but since we still require only
C99 we must plumb the information all the way from autoconf through the
various typedefs and defines.
2021-03-31 12:12:39 +02:00
Inada Naoki cfa176685a
Revert "bpo-43510: PEP 597: Accept encoding="locale" in binary mode (GH-25103)" (#25108)
This reverts commit ff3c9739bd.
2021-03-31 18:49:41 +09:00
Inada Naoki ff3c9739bd
bpo-43510: PEP 597: Accept encoding="locale" in binary mode (GH-25103)
It make `encoding="locale"` usable everywhere `encoding=None` is
allowed.
2021-03-31 14:26:08 +09:00
Terry Jan Reedy 1b4a9c7956
bpo-42225: IDLE - document two unix-related problems. (#25078)
1. Bad IP masquerade rules can prevent startup.
2. X cannot handle some complex colored chars.
2021-03-31 01:19:38 -04:00
Ethan Furman b775106d94
bpo-40066: Enum: modify repr() and str() (GH-22392)
* Enum: streamline repr() and str(); improve docs

- repr() is now ``enum_class.member_name``
- stdlib global enums are ``module_name.member_name``
- str() is now ``member_name``
- add HOW-TO section for ``Enum``
- change main documentation to be an API reference
2021-03-30 21:17:26 -07:00
Alex Prengère 51a85ddce8
bpo-43399: Fix ElementTree.extend not working on iterators (GH-24751) 2021-03-31 00:11:29 +03:00