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 — `create_task(name=...)` silently fails to set name with custom task_factory after gh-128308 · Issue #132593 · python/cpython Closed as duplicate Closed as duplicate Copy link Labels stdlibStandard 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 DescriptionBug reportBug description:During a rebuild of all packages in Debian unstable, the uvloop test suite failed due to a new behavior in asyncio. This suite runs each test twice: once with uvloop implementation (which passes) and once with Python’s asyncio implementation (which fails). Since
Expected behaviorWhen using Actual behaviorWith a custom factory that returns a My EnvironmentPython version: 3.13.2 Script to reproduceimport asyncio async def main(): names = [] async def get_name(): names.append(asyncio.current_task().get_name()) async with asyncio.TaskGroup() as tg: tg.create_task(get_name(), name="example name") print(names) asyncio.run(main()) # Output: ['example name'] def factory(): loop = asyncio.new_event_loop() loop.set_task_factory(asyncio.eager_task_factory) return loop asyncio.run(main(), loop_factory=factory) # Output: ['example name'] # Fails silently with custom task_factory result = None class MyTask(asyncio.Task): def set_name(self, name): global result print(name) # never reached result = name + "!" def get_name(self): global result return result def loop_factory(): loop = asyncio.new_event_loop() loop.set_task_factory(asyncio.create_eager_task_factory(MyTask)) return loop asyncio.run(main(), loop_factory=loop_factory) # Output: ['None'] CPython versions tested on:3.13 Operating systems tested on:Linux Reacted by John Activity
MetadataMetadataAssigneesLabelsstdlibStandard 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. |