-
Notifications
You must be signed in to change notification settings - Fork 148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Specific characters in path of parent directories of file causes debugger to crash. #1671
Comments
In retrospect, apologies for the insane examples. Luckily, I've managed to reduce the character set necessary to reproduce it. Specifically, the undermentioned path:
...works:
...whereas the undermentioned path:
...does not:
The sole difference is a single tab character, so it's a combination of the tab character and others which breaks parsing, because a directory name which is merely a tab (
|
Per #1677, I've attempted to collect some logs using this Stack Overflow answer. Specifically, the aforereferenced most-compact-but-still-breaky path yet (undermentioned):
...produces the undermentioned logs in the "Extension Host" (non-"Worker") console:
However, the aforementioned really-breaky-path doesn't create any logs when |
Looking at the other issue, we seem to translate tab characters into an escaped tab. I would guess that's the root cause of this issue. |
I'm not seeing it escaped, but rather stripped out. It happens before the path is given to debugpy. Not sure if this is a vscode-python-debugger issue, a vscode issue, or what. |
@rchiodo, indeed, it's the tabs. Working back from the right, I removed one character per test, and ascertained that
...but
...nor does merely
@debonte, that last log appears to corroberate your observation - |
The tab appears to get stripped out between the point where we send the When we send the
But when the launcher is started, the path it receives from
|
Summary
I've managed to break the path parsing. Specifically, including certain characters in the parent directories of the file being debugged causes the debugger to crash.
I don't know what specific characters cause this, but I'll update the report when(/if) I do.
Reproduction
Directory-Caused Crash
The undermentioned path, which contains a normal filename (
testfile.py
) but an abnormally named immediate parent directory:...causes
ms-python.debugpy
to crash:Merely one directory in the absolute path of the file need contain such characters for the parsing to fail, as the undermentioned "Terminal" log from
ms-python.debugpy
demonstrates:If I put the file deep enough (like this example) it completely breaks. Enter doesn't work because the path is incorrectly escaped, so
^C
is necessary to exit the transient debug state:This causes Python Debugger: "Timed out waiting for launcher to connect" #1677 to occur:
Debugger Functioning with Unusual Filename
Note that this doesn't apply to the file's name. Consider the undermentioned example:
As the undermentioned "Terminal" log demonstrates, it functions:
Environment
Filename Character Support
One must be using a filesystem and OS that support such characters. I use BTRFS on Fedora 40, but anything comparable (see https://en.wikipedia.org/w/index.php?title=Filename&oldid=1245592690#Comparison_of_filename_limitations) should work.
Versions
Code
Debugger
marketplace.visualstudio.com/_apis/public/gallery/publishers/ms-python/vsextensions/debugpy/2024.11.2024082901/vspackage?targetPlatform=linux-x64
1Miscellaneous
Potentially related to microsoft/vscode-python-debugger#233 (comment), although I doubt it, because
/home/RokeJulianLockhart/Documents/Text File.txt.py
works.Footnotes
vscode-python-debugger/releases/download/v2024.11.2024082901/extension.vsixmanifest
↩The text was updated successfully, but these errors were encountered: