GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Breaking API Change in Python 3.13.3: Task Factory Signature Change · Issue #133745 · python/cpython Closed 1 / 11 of 1 issue completedClosed 1 / 11 of 1 issue completed Copy link Labels 3.13only security fixesonly security fixes3.14bugs and security fixesbugs and security fixes3.15bugs and security fixesbugs and security fixesrelease-blockerstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-asynciotype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error DescriptionIn PR #128768 (gh-128308), the asyncio task factory signature was changed from The documentation was updated to reflect this new contract:
This change causes runtime errors for any code with task factories implemented according to the previous contract, as these factories now unexpectedly receive keyword arguments like Reproducerimport asyncio # Task factory implemented according to the previous API contract def old_style_task_factory(loop, coro, context=None): print(f"Creating task with loop={loop}, coro={coro}, context={context}") return asyncio.Task(coro, loop=loop) async def main(): # Set up a custom task factory following the old documented API loop = asyncio.get_event_loop() loop.set_task_factory(old_style_task_factory) # This will fail with TypeError due to unexpected 'name' argument print("Attempting to create task with name...") await loop.create_task(asyncio.sleep(0.1), name="test_task") print("Task completed successfully") # We won't reach this line if __name__ == "__main__": try: asyncio.run(main()) except TypeError as e: print(f"ERROR: {e}") # Output: ERROR: old_style_task_factory() got an unexpected keyword argument 'name' This prints: This is a breaking change introduced in a patch release, which violates our versioning policy. The change was intended to support the CPython versions tested on:3.14 Operating systems tested on:Linux Linked PRsActivity
MetadataMetadataAssigneesLabels3.13only security fixesonly security fixes3.14bugs and security fixesbugs and security fixes3.15bugs and security fixesbugs and security fixesrelease-blockerstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-asynciotype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error Projects
MilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |