Closed j9ac9k closed 9 months ago
This issue was introduced in PyCharm Debugger 2023.3.3
.
It's caused by debugger hooks found in pydevd_nest_asyncio.py
file, which monkey-patches the default asyncio.Task implementation (also used by qasync), resulting in this behaviour. As for what exactly changed, I'm not sure.
Rolling back to PyCharm 2023.2.5
fixes the issue.
UPD: Now I'm not sure about pydevd_nest_asyncio.py
being the culprit, as when comparing them between two versions, there seems to be only 3 LOC difference, and It doesn't change anything in my case, so the issue could lie deeper, perhaps within pydevd
.
I think the debugger works in a newer version, 2023.3.1, I believe the breakage started at 2023.3.2. I'd be happy to open an issue in the pycharm bug tracker but I don't think I could explain the issue sufficiently (or in a way that won't make them point the finger back at this library).
Need to identify what's causing this behaviour and there's something qasync can do to avoid rasing an exception. Unfortunately I don't use pycharm so not able to reproduce this.
Need to identify what's causing this behaviour and there's something qasync can do to avoid rasing an exception. Unfortunately I don't use pycharm so not able to reproduce this.
Happy to try and drop into a debugger (heh) before the exception is raised and explore some, but I'm not sure what I should be looking for.
Hi guys, I can confirm what j9ac9k wrote. The breakage started with version 2023.3.2 and it also holds with version 2023.3.3
I think the debugger works in a newer version, 2023.3.1, I believe the breakage started at 2023.3.2. I'd be happy to open an issue in the pycharm bug tracker but I don't think I could explain the issue sufficiently (or in a way that won't make them point the finger back at this library).
This message describes the solution to this issue
Pycharm 2023.3.3 enabled asyncio support for the debugger, which was disabled before, even though the files were included with pydevd.
As of now, the only solution is to disable asyncio support for the debugger (which was disabled before in the first place, so It won't be a big loss for those who have only encountered the issue just now).
This can be done by following the steps described here.
In short:
Registry...
(with ...) and press EnterRegistry...
in the list of results and click on it.python.debug.asyncio.repl
line and uncheck the respective checkboxConsidering that other event loop implementations have the same issues, I think it would be unwise to spend time trying to fix it in qasync, as JetBrains might fix it on their end. But it might be worth it for someone to chime in on the tracker so they take qasync into account
Nice find on the existing issue elsewhere, it's a little disheartening that so many posts are about them not being able to replicate the issue.
Given there is a respective issue is already reported upstream, a workaround is posted, and this issue is present with another async library, I'm going to close out the issue. Sorry for the noise, but thanks for pointing out the upstream issue @kormax
https://youtrack.jetbrains.com/issue/PY-62467
Upstream issue marked as fixed, but fixed version isn't specified... so assuming it it will be resolved in the next release?
Hello qasync maintainers,
Love the library! I am running into an issue that I don't know if it's an issue with PyCharm or an issue with the library. I figured I'd post here for insight.
When running a qasync application with the pycharm debugger, this exception is triggered right away, specifically the
if not callable(callback)
if-statemenet.The example code:
To trigger the fault, inside pycharm run the debugger on this file.
For extra debug information:
EDIT: Realized I didn't provide the full stack-trace, my apologies: