Skip to content
This repository has been archived by the owner on Aug 2, 2023. It is now read-only.

Python-Extension: Debugger not running with Python 2.7 #2112

Closed
dpalmetzvbg opened this issue Mar 12, 2020 · 9 comments
Closed

Python-Extension: Debugger not running with Python 2.7 #2112

dpalmetzvbg opened this issue Mar 12, 2020 · 9 comments

Comments

@dpalmetzvbg
Copy link

When trying to make a python-program with VSCode (Python 2.7.14) and run the debugger, an exception occurse. The program is very small:

Everything works perfectly well with python-3 environments.

import os
pass

Running without debugger is possible.

Environment data

  • VS Code version: 1.43.0
  • Extension version (available under the Extensions sidebar): Python-Extension 2020.2.64397
  • OS and version: Windows 10 64 Bit (German)
  • Python version (& distribution if applicable, e.g. Anaconda): 2.7.14 (shipps with ArcGis)
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): N/A
  • Relevant/affected Python packages and their versions: none
  • Relevant/affected Python-related VS Code extensions and their versions: Python-Extension
  • Jedi or Language Server? (i.e. what is "python.jediEnabled" set to; more info How to update the language server to the latest stable version vscode-python#3977): XXX
  • Value of the python.languageServer setting: XXX

Expected behaviour

The debugger should start.

Actual behaviour

Exception is thrown.

Steps to reproduce:

Create a pyhton-file, save it and start the debugger.

Logs

 XXX

Output from Console under the Developer Tools panel (toggle Developer Tools on under Help; turn on source maps to make any tracebacks be useful by running Enable source map support for extension debugging)

 cd 'c:\Entwicklung\Python\Django_Test_P3_6'; ${env:PYTHONIOENCODING}='UTF-8'; ${env:PYTHONUNBUFFERED}='1'; & 'C:\Python27\ArcGIS10.4\python.exe' 'c:\Users\<userdir>\.vscode\extensions\ms-python.python-2020.2.64397\pythonFiles\ptvsd_launcher.py' '--default' '--client' '--host' 'localhost' '--port' '52684' 'd:\Entwicklung\Django_Test_36\test1.py'
Traceback (most recent call last):
  File "c:\Users\<userdir>\.vscode\extensions\ms-python.python-2020.2.64397\pythonFiles\lib\python\old_ptvsd\ptvsd\_vendored\pydevd\_pydevd_bundle\pydevd_comm.py", line 283, in _on_run
    self.process_net_command_json(self.global_debugger_holder.global_dbg, json_contents)
  File "c:\Users\<userdir>\.vscode\extensions\ms-python.python-2020.2.64397\pythonFiles\lib\python\old_ptvsd\ptvsd\_vendored\pydevd\_pydevd_bundle\pydevd_process_net_command_json.py", line 164, in process_net_command_json
    cmd = on_request(py_db, request)
  File "c:\Users\<userdir>\.vscode\extensions\ms-python.python-2020.2.64397\pythonFiles\lib\python\old_ptvsd\ptvsd\_vendored\pydevd\_pydevd_bundle\pydevd_process_net_command_json.py", line 490, in on_setbreakpoints_request
    py_db, filename, btype, breakpoint_id, line, condition, func_name, expression, suspend_policy, hit_condition, is_logpoint, adjust_line=True)
  File "c:\Users\<userdir>\.vscode\extensions\ms-python.python-2020.2.64397\pythonFiles\lib\python\old_ptvsd\ptvsd\_vendored\pydevd\_pydevd_bundle\pydevd_api.py", line 424, in add_breakpoint
    py_db.apply_files_filter(self._DummyFrame(filename), filename, False)
  File "c:\Users\<userdir>\.vscode\extensions\ms-python.python-2020.2.64397\pythonFiles\lib\python\old_ptvsd\ptvsd\_vendored\pydevd\pydevd.py", line 964, in apply_files_filter
    if (self._is_libraries_filter_enabled or force_check_project_scope) and not self.in_project_scope(frame):
  File "c:\Users\<userdir>\.vscode\extensions\ms-python.python-2020.2.64397\pythonFiles\lib\python\old_ptvsd\ptvsd\_vendored\pydevd\pydevd.py", line 866, in in_project_scope
    file_type = self.get_file_type(frame, abs_real_path_and_basename)
  File "c:\Users\<userdir>\.vscode\extensions\ms-python.python-2020.2.64397\pythonFiles\lib\python\old_ptvsd\ptvsd\_vendored\pydevd\pydevd.py", line 705, in get_file_type
    if self.dont_trace_external_files(abs_real_path_and_basename[0]):
  File "c:\Users\<userdir>\.vscode\extensions\ms-python.python-2020.2.64397\pythonFiles\lib\python\old_ptvsd\ptvsd\_vendored\pydevd\_pydevd_bundle\pydevd_api.py", line 758, in custom_dont_trace_external_files
    return abs_path.startswith(start_patterns) or abs_path.endswith(end_patterns)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xfc in position 72: ordinal not in range(128)
@karthiknadig karthiknadig transferred this issue from microsoft/vscode-python Mar 12, 2020
@karthiknadig
Copy link
Member

Can you try with the new debugger? Instructions here on how to turn it on.
#2104

@dpalmetzvbg
Copy link
Author

dpalmetzvbg commented Mar 16, 2020 via email

@dpalmetzvbg
Copy link
Author

dpalmetzvbg commented Mar 16, 2020 via email

@karthiknadig
Copy link
Member

@dpalmetzvbg Check these settings, they should both be checked:
#2104 (comment)

If that do not fix then check the extension folder to see if multiple version of python extension are installed?
If so, then delete them all and follow instructions again #2104

If that does not work, please share your settings.json (redact any personal information)

@dpalmetzvbg
Copy link
Author

dpalmetzvbg commented Mar 17, 2020 via email

@dpalmetzvbg
Copy link
Author

dpalmetzvbg commented Mar 17, 2020 via email

@int19h
Copy link
Contributor

int19h commented Mar 17, 2020

You're hitting microsoft/debugpy#69 now. We already have a fix, but until it gets into a new release, the workaround is to not use paths with non-ASCII characters on Python 2.7.

@dpalmetzvbg
Copy link
Author

dpalmetzvbg commented Mar 17, 2020 via email

@int19h
Copy link
Contributor

int19h commented Mar 17, 2020

Thank you for confirming! I'm going to close this issue as a duplicate.

@int19h int19h closed this as completed Mar 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants