From unknown Sun Jun 22 00:43:55 2025 X-Loop: help-debbugs@gnu.org Subject: bug#50267: Python PYTHONASYNCIODEBUG=1 not triggering debug tracebacks Resent-From: Ben Sturmfels Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Mon, 30 Aug 2021 13:02:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 50267 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 50267@debbugs.gnu.org X-Debbugs-Original-To: bug-guix@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.163032849611624 (code B ref -1); Mon, 30 Aug 2021 13:02:01 +0000 Received: (at submit) by debbugs.gnu.org; 30 Aug 2021 13:01:36 +0000 Received: from localhost ([127.0.0.1]:58448 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mKguo-00031J-7J for submit@debbugs.gnu.org; Mon, 30 Aug 2021 09:01:36 -0400 Received: from lists.gnu.org ([209.51.188.17]:34834) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mKguh-000314-H0 for submit@debbugs.gnu.org; Mon, 30 Aug 2021 09:01:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58984) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mKgug-0002Ed-QR for bug-guix@gnu.org; Mon, 30 Aug 2021 09:01:22 -0400 Received: from wout4-smtp.messagingengine.com ([64.147.123.20]:41423) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mKgua-0003Xd-Po for bug-guix@gnu.org; Mon, 30 Aug 2021 09:01:22 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 7139A320082A for ; Mon, 30 Aug 2021 09:01:14 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Mon, 30 Aug 2021 09:01:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sturm.com.au; h= from:to:subject:date:message-id:mime-version:content-type; s= fm3; bh=UL4J25eFY0oylS9mwvsEILjNItWFUiELuPtnSnI/ek0=; b=XhzGVrBr 8TdWJHw3c/h10aMgCWXz8zPqUMkiIRBkGrBvDUzaSZB/qkSe4s9OgwKV/mP7RC/L bYhR7HL3Z0AtqyhKxfIIPk0J4R/wOkwDB0dTE3Uq0vHDH5qT0pvorQ0WylbfYAU9 dtSTjp1MTKV22wn/oNHQR+NGrw/oAAvbWyPxqK8/YGWRmmtTHT464pLXo5bOpUvM g/cngN+jLQyXjGB3HFQNFVy6Hiqh8KuHnd90F9mNQEBvifbEDWrRJS6FJ5e5iBTt 9xk5d3fstn29OyK4S8GMzHkNWwbSSUuBymg+i4MsfhaWg9BN+FlbhDnqQMlL9qhV V+e7S9kxvkTomQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:message-id :mime-version:subject:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; bh=UL4J25eFY0oylS9mwvsEILjNItWFU iELuPtnSnI/ek0=; b=oUdhzs8YwN88NeFgUpacOJN8Rjwr+UXqDLmvY/D/VD1+p NL2hA75oGWFU9XhdLhz945RqwDSjHMB3gPY+D+SZL82Ja9Ua1R9+MZHjE+iI9spk eDAHiSLH5TNNuqXSemIZ2B0+QtcUHYKjWr7Q+cb7kQPPrGXxgWRehDRqRg0kCHWy mKPd0oN9EFxnRYFzU0fFujgctCqUvTR5nbBKiQEld0v1mXSrTOXvUHAxSXQ/fLr8 DFjDiQ3/pcdIk8ZxI2gBBfjfEdg8luwQWi1XfaDCXWWuu6/O3p+S6VIVy4gXxHlm UzT9Ji3VdNXXeU8Ag8hyokNg91tKUuGf+nv91QSOQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudduledgheelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpegfhffvufffkfggtgesthdtredttd ertdenucfhrhhomhepuegvnhcuufhtuhhrmhhfvghlshcuoegsvghnsehsthhurhhmrdgt ohhmrdgruheqnecuggftrfgrthhtvghrnhepieejieefgfegtdffleeggeffkefghfegfe elkedvvdevkeetveffvdfgueeiieeknecuffhomhgrihhnpehphihthhhonhdrohhrghen ucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegsvghnse hsthhurhhmrdgtohhmrdgruh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Mon, 30 Aug 2021 09:01:12 -0400 (EDT) Received: from Marseille (localhost [127.0.0.1]) by localhost (OpenSMTPD) with ESMTP id a2925da6 for ; Mon, 30 Aug 2021 13:01:08 +0000 (UTC) User-agent: mu4e 1.6.5; emacs 27.2 From: Ben Sturmfels Date: Mon, 30 Aug 2021 22:45:19 +1000 Message-ID: <87v93n9jeg.fsf@sturm.com.au> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=64.147.123.20; envelope-from=ben@sturm.com.au; helo=wout4-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.6 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.3 (/) Hi Folks, When I run a Python program with PYTHONASYNCIODEBUG=1, I'm not seeing the debugging traceback I expect. Here's the test program, asynctest.py containing an async bug: import asyncio async def test(): print("never scheduled") async def main(): # Should be "async test()" test() asyncio.run(main()) Run this with `python3 asynctest.py` I get as expected: asynctest.py:7: RuntimeWarning: coroutine 'test' was never awaited test() RuntimeWarning: Enable tracemalloc to get the object allocation traceback Running with `PYTHONASYNCIODEBUG=1 python3 asynctest.py`, I don't see any additional debugging output: asynctest.py:7: RuntimeWarning: coroutine 'test' was never awaited test() RuntimeWarning: Enable tracemalloc to get the object allocation traceback I tried running it inside a `guix environment --container` just in case it was my setup, but no difference. But on Ubuntu 20.04 (also Python 3.8), I get the expected debugging output: asynctest.py:7: RuntimeWarning: coroutine 'test' was never awaited Coroutine created at (most recent call last) File "asynctest.py", line 9, in asyncio.run(main()) File "/usr/lib/python3.8/asyncio/runners.py", line 44, in run return loop.run_until_complete(main) File "/usr/lib/python3.8/asyncio/base_events.py", line 603, in run_until_complete self.run_forever() File "/usr/lib/python3.8/asyncio/base_events.py", line 570, in run_forever self._run_once() File "/usr/lib/python3.8/asyncio/base_events.py", line 1851, in _run_once handle._run() File "/usr/lib/python3.8/asyncio/events.py", line 81, in _run self._context.run(self._callback, *self._args) File "t.py", line 7, in main test() test() RuntimeWarning: Enable tracemalloc to get the object allocation traceback See also: https://docs.python.org/3.8/library/asyncio-dev.html#asyncio-debug-mode Regards, Ben