Skip to content

Python debuger won't store strings with double underscores #592

@rickstaa

Description

@rickstaa

Environment data

Vscode about

Version: 1.56.0-insider
Commit: 8aff878db2542eea2dfb571c8bb485118bbb3113
Date: 2021-04-19T05:14:11.109Z
Electron: 12.0.4
Chrome: 89.0.4389.114
Node.js: 14.16.0
V8: 8.9.255.24-electron.0
OS: Linux x64 5.8.0-49-generic

Other system info

  • Extension version (available under the Extensions sidebar): v2021.5.756443519-dev
  • OS and version: Ubuntu 20.04
  • Python version (& distribution if applicable, e.g. Anaconda): 3.8.8 64-bit
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): Conda
  • Relevant/affected Python packages and their versions: standard library
  • Relevant/affected Python-related VS Code extensions and their versions: ptvsd
  • Value of the python.languageServer setting: Pylance

[NOTE: If you suspect that your issue is related to the Microsoft Python Language Server (python.languageServer: 'Microsoft'), please download our new language server Pylance from the VS Code marketplace to see if that fixes your issue]

Expected behaviour

I am unable to store string variables that contain a double underscore when I am debugging a process. I understand that starting a python class attribute __ causes name mangling but here I just simply try to store two underscores (see gif below). The code works fine when it is executed outside the debugger.

Actual behaviour

The debugger returns None and no variable is created.

problem_underscore

Steps to reproduce:

[NOTE: Self-contained, minimal reproducing code samples are extremely helpful and will expedite addressing your issue]

  1. Debug the following python script.
test = "__test"
print(test)
test2 = test.strip("__")
print(test2)
print("script ended")
  1. Place a debug point on line 5.
  2. Type test3="__test" into the debug console.
  3. Type test4="test__test" into the debugger.
  4. In both cases note that no variables are created.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions