summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* gh-105751: Remove dead code in test_ctypes (#105817)Victor Stinner2023-06-1515-128/+37
| | | | | * Remove "except: print(tp); raise" debug code. * Remove unused NoNullHandle() function. * Remove commented code.
* More reorganisation of the typing docs (#105787)Alex Waygood2023-06-151-101/+117
|
* Improve docs for `typing.dataclass_transform` (#105792)Alex Waygood2023-06-151-37/+69
|
* GH-89812: Churn `pathlib.Path` test methods (#105807)Barney Gale2023-06-151-315/+315
| | | | | | | | | | | | | | Re-arrange `pathlib.Path` test methods in source code. No other changes. The test methods are arranged in two groups. The first group checks `stat()`, `open()`, `iterdir()`, `readlink()`, and derived methods like `exists()`, `read_text()`, `glob()` and `resolve()`. The second group checks all other `Path` methods. To minimise the diff I've maintained the method order within groups where possible. This patch prepares the ground for a new `_AbstractPath` class, which will support methods in the first group above. By churning the test methods here, subsequent patches will be easier to review and less likely to break things.
* gh-105800: Issue SyntaxWarning in f-strings for invalid escape sequences ↵Pablo Galindo Salgado2023-06-153-3/+8
| | | | (#105801)
* gh-105751: Cleanup test_ctypes imports (#105803)Victor Stinner2023-06-1445-240/+250
| | | | | | * Move imports at top level and sort imports. * Replace c_buffer() with create_string_buffer(): c_buffer is a deprecated alias. * PEP 8: Add empty lines for readability between imports and classes.
* gh-105481: add HAS_JUMP flag to opcode metadata (#105791)Irit Katriel2023-06-148-168/+189
|
* gh-105751: test_ctypes avoids the operator module (GH-105797)Victor Stinner2023-06-1410-80/+85
| | | | | | | * Replace operator.delitem(obj, index) with "del obj[index]". * Replace operator.setitem(obj, index, value) with "obj[index] = value". * Replace delattr(obj, "attr) with "del obj.attr". * Replace grc() with sys.getrefcount() for readability.
* gh-105751: test_ctypes: Remove @need_symbol decorator (GH-105798)Victor Stinner2023-06-1417-66/+10
| | | | | | | | | | Remove the @need_symbol('...') decorator of test.test_ctypes since requested symbols are now always always available in ctypes. Use the @unittest.skipUnless() decorator directly for the two types only available on Windows: * ctypes.WINFUNCTYPE * ctypes.oledll
* gh-104909: Implement conditional stack effects for macros (#105748)Guido van Rossum2023-06-142-13/+80
|
* gh-75905: Remove test_xmlrpc_net: skipped since 2017 (#105796)Victor Stinner2023-06-141-31/+0
| | | | | | | test_xmlrpc_net was skipped since 2017: commit 73ffd3f2036179ed54591ef0455e5ba5694ae5bd. The public buildbot.python.org server has no XML-RPC interface anymore, and no replacement server was found in 6 years.
* gh-105481: Fix types and a bug for pseudos (#105788)Guido van Rossum2023-06-141-3/+4
|
* Update DSL docs for cases generator (#105753)Guido van Rossum2023-06-141-44/+60
| | | | | * Clarify things around goto error/ERROR_IF a bit * Remove docs for super-instructions * Add pseudo; fix heading markup
* GH-77273: Better bytecodes for f-strings (GH-6132)Mark Shannon2023-06-1415-479/+519
|
* xmlrpc.client uses datetime.datetime.isoformat() (#105741)Victor Stinner2023-06-142-32/+12
| | | | | | Reimplement _iso8601_format() using the datetime isoformat() method. Ignore the timezone. Co-Authored-by: Paul Ganssle <1377457+pganssle@users.noreply.github.com>
* gh-105570: Deprecate unusual ways of creating empty TypedDicts (#105780)Alex Waygood2023-06-145-8/+73
| | | Deprecate two methods of creating typing.TypedDict classes with 0 fields using the functional syntax: `TD = TypedDict("TD")` and `TD = TypedDict("TD", None)`. Both will be disallowed in Python 3.15. To create a TypedDict class with 0 fields, either use `class TD(TypedDict): pass` or `TD = TypedDict("TD", {})`.
* gh-105196: Fix indentations of section headings in C API docs (#105672)TATHAGATA ROY2023-06-143-6/+6
|
* Typing docs: move the deprecated stuff below the non-deprecated stuff (#105781)Alex Waygood2023-06-141-488/+488
|
* GH-100987: Allow objects other than code objects as the "executable" of an ↵Mark Shannon2023-06-1428-607/+542
| | | | | | | | | | internal frame. (GH-105727) * Add table describing possible executable classes for out-of-process debuggers. * Remove shim code object creation code as it is no longer needed. * Make lltrace a bit more robust w.r.t. non-standard frames.
* gh-105566: Deprecate unusual ways of creating `typing.NamedTuple` classes ↵Alex Waygood2023-06-145-12/+153
| | | | | | | (#105609) Deprecate creating a typing.NamedTuple class using keyword arguments to denote the fields (`NT = NamedTuple("NT", x=int, y=str)`). This will be disallowed in Python 3.15. Use the class-based syntax or the functional syntax instead. Two methods of creating `NamedTuple` classes with 0 fields using the functional syntax are also deprecated, and will be disallowed in Python 3.15: `NT = NamedTuple("NT")` and `NT = NamedTuple("NT", None)`. To create a `NamedTuple` class with 0 fields, either use `class NT(NamedTuple): pass` or `NT = NamedTuple("NT", [])`.
* gh-104873: Add typing.get_protocol_members and typing.is_protocol (#104878)Jelle Zijlstra2023-06-145-2/+152
| | | Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* gh-102541: Hide traceback in help prompt (gh-102614)Kirill Podoprigora2023-06-142-8/+14
|
* gdb libpython.py: Remove compatibility code (#105739)Victor Stinner2023-06-141-47/+22
| | | | | | | | Remove compatibility code for Python 2 and early Python 3 versions. * Remove os_fsencode() reimplementation: use os.fsencode() directly. os.fsencode() was added to Python 3.2. * Remove references to Python 2 and "Python 3": just say "Python". * Remove outdated u'' string format: use '' instead.
* gh-105745: Fix open method of webbrowser.Konqueror (#105746)Nikita Sobolev2023-06-142-9/+1
|
* gh-105687: Remove deprecated objects from `re` module (#105688)Nikita Sobolev2023-06-149-56/+13
|
* _ctypes callbacks.c uses _Py_COMP_DIAG_IGNORE_DEPR_DECLS (#105732)Victor Stinner2023-06-141-16/+20
| | | | | | Replace #pragma with _Py_COMP_DIAG_PUSH, _Py_COMP_DIAG_IGNORE_DEPR_DECLS and _Py_COMP_DIAG_POP to ease Python maintenance. Also add a comment explaining why callbacks.c ignores a deprecation warning.
* tarfile: Fix positional-only syntax in docs (GH-105770)Jelle Zijlstra2023-06-141-4/+4
| | | | | | | | The syntax used in the current docs (a / before any args) is invalid. I think the right approach is for the arguments to arbitrary filter functions to be treated as positional-only, meaning that users can supply filter functions with any names for the argument. tarfile.py only calls the filter function with positional arguments.
* gh-105587: Remove assertion from `_PyStaticObject_CheckRefcnt` (#105638)Eddie Elizondo2023-06-142-3/+5
|
* GH-89812: Clean up pathlib tests. (#104829)Barney Gale2023-06-141-84/+96
| | | | | | Clean up pathlib tests. Merge `PurePathTest` into `_BasePurePathTest`, and `PathTest` into `_BasePathTest`.
* gh-105751: test_ctypes avoids "from ctypes import *" (#105768)Victor Stinner2023-06-1448-83/+179
| | | | | | Using "import *" prevents linters like pyflakes to detect undefined names (usually missing imports). Replace c_voidp with c_void_p.
* gh-105751: test_ctypes.test_numbers uses top level imports (#105762)Victor Stinner2023-06-141-32/+8
| | | Moroever, c_ulonglong and c_bool are always available.
* gh-105751: test_ctypes gets Windows attrs from ctypes (#105758)Victor Stinner2023-06-1411-64/+75
| | | | | | | | | | | | | | | test_ctypes now gets attributes specific to Windows from the ctypes module, rather than relying on "from ctypes import *". Attributes: * ctypes.FormatError * ctypes.WINFUNCTYPE * ctypes.WinError * ctypes.WinDLL * ctypes.windll * ctypes.oledll * ctypes.get_last_error() * ctypes.set_last_error()
* gh-105699: Use a Thread-Local Variable for PKGCONTEXT (gh-105740)Eric Snow2023-06-144-1/+24
| | | This fixes a race during import. The existing _PyRuntimeState.imports.pkgcontext is shared between interpreters, and occasionally this would cause a crash when multiple interpreters were importing extensions modules at the same time. To solve this we add a thread-local variable for the value. We also leave the existing state (and infrequent race) in place for platforms that do not support thread-local variables.
* gh-104812: Skip Pending Calls Tests if No Threading (gh-105761)Eric Snow2023-06-141-0/+2
| | | This fixes the WASM buildbots.
* gh-105387: Limited C API implements Py_INCREF() as func (#105388)Victor Stinner2023-06-143-8/+18
| | | | | In the limited C API version 3.12, Py_INCREF() and Py_DECREF() functions are now implemented as opaque function calls to hide implementation details.
* GH-104554: Add RTSPS support to `urllib/parse.py` (#104605)zentarim2023-06-133-8/+9
| | | | | | | | | | | | | * GH-104554: Add RTSPS support to `urllib/parse.py` RTSPS is the permanent scheme defined in https://www.iana.org/assignments/uri-schemes/uri-schemes.xhtml alongside RTSP and RTSPU schemes. * 📜🤖 Added by blurb_it. --------- Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
* gh-105436: Ignore unrelated errors when checking empty env (GH-105742)Steve Dower2023-06-131-3/+4
|
* gh-98040: Fix importbench: use types.ModuleType() (#105743)Victor Stinner2023-06-132-1/+4
| | | Replace removed imp.new_module(name) with types.ModuleType(name).
* gh-104812: Run Pending Calls in any Thread (gh-104813)Eric Snow2023-06-1316-118/+761
| | | For a while now, pending calls only run in the main thread (in the main interpreter). This PR changes things to allow any thread run a pending call, unless the pending call was explicitly added for the main thread to run.
* gh-102613: Bump recursion limit to fix running test_pathlib under Coverage ↵Łukasz Langa2023-06-131-1/+1
| | | | (#105744)
* gh-105481: add flags to each instr in the opcode metadata table, to replace ↵Irit Katriel2023-06-136-623/+679
| | | | opcode.hasarg/hasname/hasconst (#105482)
* gh-105733: Deprecate ctypes SetPointerType() and ARRAY() (#105734)Victor Stinner2023-06-135-9/+47
|
* gh-105603: Change the PyInterpreterConfig.own gil Field (gh-105620)Eric Snow2023-06-136-16/+40
| | | We are changing it to be more flexible that a strict bool can be for possible future expanded used cases.
* gh-105718: Fix buffer allocation in tokenizer with readline (#105728)Lysandros Nikolaou2023-06-133-5/+11
|
* gh-105373: Remove PyArg_Parse() deprecation (#105394)Victor Stinner2023-06-131-8/+16
| | | | | | There is no plan to deprecate PyArg_Parse(). The deprecation was added as a comment in the C API documentation in 2007 by commit 85eb8c103c9e460917911b43c6be302c30d75efb.
* gh-105713: Document that tokenize raises when mixing tabs/spaces (#105723)Lysandros Nikolaou2023-06-131-0/+3
| | | | | | * gh-105713: Document that tokenize raises when mixing tabs/spaces * Update Doc/whatsnew/3.12.rst Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* Fix magic number (GH-105722)Mark Shannon2023-06-131-3/+2
|
* GH-105678: Split MAKE_FUNCTION into MAKE_FUNCTION and SET_FUNCTION_ATTRIBUTE ↵Mark Shannon2023-06-1312-430/+480
| | | | (GH-105680)
* gh-105375: Improve error handling in _Unpickler_SetInputStream() (#105667)Erlend E. Aasland2023-06-132-13/+20
| | | | Prevent exceptions from possibly being overwritten in case of multiple failures.
* GH-105684: Require `asyncio.Task` implementations to support `set_name` ↵Kumar Aditya2023-06-135-16/+8
| | | | method (#105685)