[issue40454] DEBUG kw to asyncio.run overrides DEBUG mode set elsewhere

2022-03-12 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

Fixed by #41696

--
resolution:  -> duplicate
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40454] DEBUG kw to asyncio.run overrides DEBUG mode set elsewhere

2020-05-04 Thread Yury Selivanov


Yury Selivanov  added the comment:

Good catch. The function should be fixed to:

  _marker = object()

  def run(coro, *, debug=_marker):
 if debug is not _marker:
loop.set_debug(debug)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40454] DEBUG kw to asyncio.run overrides DEBUG mode set elsewhere

2020-05-03 Thread Zackery Spytz


Change by Zackery Spytz :


--
keywords: +patch
nosy: +ZackerySpytz
nosy_count: 3.0 -> 4.0
pull_requests: +19206
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/19895

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40454] DEBUG kw to asyncio.run overrides DEBUG mode set elsewhere

2020-04-30 Thread Paul Martin


New submission from Paul Martin :

According to the docs:

"
There are several ways to enable asyncio debug mode.

Setting the PYTHONASYNCIODEBUG environment variable to 1.
Using the -X dev Python command line option.
Passing debug=True to asyncio.run().
Calling loop.set_debug().
"

My understanding of this would be that any of the above methods can be used to 
enable debug mode. However if asyncio.run is used then whatever value for DEBUG 
is passed to asyncio.run (or False by default) overrides DEBUG mode being set 
elsewhere. So, when asyncio.run is used, the only way to enable DEBUG mode is 
to pass DEBUG=True to asyncio.run. The other methods won't work. 

One solution might be to change this line in asyncio/runners.py:

loop.set_debug(debug)

To

loop.set_debug(debug or coroutines._DEBUG)

So asyncio.run won't disable debug mode if it's already been set elsewhere

--
components: asyncio
messages: 367779
nosy: asvetlov, primal, yselivanov
priority: normal
severity: normal
status: open
title: DEBUG kw to asyncio.run overrides DEBUG mode set elsewhere
versions: Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com