Skip to content
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

Path with non-ASCII characters won't hit breakpoints #688

Closed
kzhui125 opened this issue Feb 2, 2018 · 9 comments · Fixed by #2218
Closed

Path with non-ASCII characters won't hit breakpoints #688

kzhui125 opened this issue Feb 2, 2018 · 9 comments · Fixed by #2218
Assignees
Labels
area-debugging bug Issue identified by VS Code Team member as probable bug

Comments

@kzhui125
Copy link

kzhui125 commented Feb 2, 2018

Environment data

VS Code version: 1.19.3
Python Extension version: 0.9.1
Python Version: Python 2.7 64bit
OS and version: Win10 Chinese Simplified

the folder path has chinese string

C:\Users\Name\.vscode\extensions\ms-python.python-0.9.1\pythonFiles\PythonTools\visualstudio_py_debugger.py:1669: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal
  if module.filename.lower() == path.abspath(bp.filename).lower():
C:\Users\Name\.vscode\extensions\ms-python.python-0.9.1\pythonFiles\PythonTools\visualstudio_py_debugger.py:1089: UnicodeWarning: Unicode unequal comparison failed to convert both arguments to Unicode - interpreting them as being unequal
  if filename != frame.f_code.co_filename:
{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Python",
            "type": "python",
            "request": "launch",
            "stopOnEntry": false,
            "pythonPath": "${config:python.pythonPath}",
            "program": "${file}",
            "cwd": "${workspaceFolder}",
            "env": {},
            "envFile": "${workspaceFolder}/.env",
            "debugOptions": [
                "RedirectOutput"
            ]
        },
        {
            "type": "node",
            "request": "launch",
            "name": "nodejs",
            "program": "${file}"
        }
    ]
}
@DonJayamanne DonJayamanne added bug Issue identified by VS Code Team member as probable bug awaiting 1-verification area-debugging labels Feb 2, 2018
@ericsnowcurrently ericsnowcurrently self-assigned this Feb 12, 2018
@ericsnowcurrently
Copy link
Member

@kzhui125, thanks for letting us know about this problem. We're looking into it.

@ericsnowcurrently
Copy link
Member

@kzhui125, could you check if you have the same problem under Python 3?

@ericsnowcurrently ericsnowcurrently added the info-needed Issue requires more information from poster label Feb 12, 2018
@ericsnowcurrently ericsnowcurrently removed their assignment Feb 12, 2018
@ericsnowcurrently
Copy link
Member

FTR:

I expect that this is not a problem under Python 3. Under Python 2 it is problably a matter of coercing bytes to unicode (e.g. in the code that calls add_breakpoint()).

@DonJayamanne
Copy link

@ericsnowcurrently worth checking whether this is an issue in the experimental debugger.

@kzhui125
Copy link
Author

@ericsnowcurrently no problem using Python 3

Thanks.

@seishun
Copy link

seishun commented Mar 30, 2018

I just encountered this issue while trying to debug a Python script that misbehaves with non-ASCII paths. 🤦‍♂️

With Python Experimental, breakpoints don't work at all. With normal Python debugger, breakpoints work but they show up as "Unknown Source".

@brettcannon brettcannon added needs verification and removed info-needed Issue requires more information from poster labels Apr 2, 2018
@brettcannon brettcannon changed the title can't debug py file Path with non-ASCII characters won't hit breakpoints Apr 2, 2018
@brettcannon
Copy link
Member

I can confirm that:

  1. Old debugger + Python 3 is fine
  2. Old debugger + Python 2 just falls over with a Unicode error
  3. Experimental debugger + Python 3 is fine
  4. Experimental debugger + Python 2 just ignores the breakpoint

So that last one is what we should try to fix.

@brettcannon brettcannon added this to the May 2018 milestone May 7, 2018
@DonJayamanne
Copy link

File upstream issue microsoft/ptvsd#421

@DonJayamanne DonJayamanne modified the milestones: May 2018, June 2018 May 23, 2018
@brettcannon brettcannon removed this from the June 2018 milestone Jun 4, 2018
@DonJayamanne
Copy link

This has been fixed in the latest version of the experimental debugger.

brettcannon pushed a commit that referenced this issue Aug 1, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Aug 29, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-debugging bug Issue identified by VS Code Team member as probable bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants