Skip to content

Always picks up ptvsd from extensions directory #2818

@karthiknadig

Description

@karthiknadig

Environment data

  • VS Code version: 1.27.1
  • Extension version (available under the Extensions sidebar): master
  • OS and version: windows
  • Python version (& distribution if applicable, e.g. Anaconda): any
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): N/A
  • Relevant/affected Python packages and their versions: XXX

Actual behavior

Setting PYTHONPATH has no effect while ptvsd.

Expected behavior

Should import ptvsd from current path first.

Steps to reproduce:

  1. git clone https://github.com/Microsoft/ptvsd in C:\
  2. In launch.json set "env": {"PYTHONPATH":"C:\\ptvsd"},
  3. Use this test code:
import ptvsd
print(ptvsd.__file__)
  1. Output should be: C:\ptvsd\ptvsd\__init__.py

Solution

Change ptvsd_launcher.py to append the extension path to sys.path instead of inserting.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions