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

plugin fails to find ptvsd if path has trailing separator. #17

Closed
MagusLucius opened this issue May 3, 2020 · 0 comments
Closed

plugin fails to find ptvsd if path has trailing separator. #17

MagusLucius opened this issue May 3, 2020 · 0 comments
Labels
bug Something isn't working

Comments

@MagusLucius
Copy link

Add-on Version: 1.0.0
Blender Version: 2.82
VS Code Version: 1.44

if where, which or whereis returns a path with a trailing separator (e.g. "/" ) the blender plugin fails to find ptvsd because it tries to append "/ptvsd" to the path.

recommend inserting path = path.rstrip('/') here:

for path in sys.path:
      if os.path.exists(path+"/ptvsd"):
         return path
      if os.path.exists(path+"/site-packages/ptvsd"):
         return path+"/site-packages"
      if os.path.exists(path+"/lib/site-packages/ptvsd"):
         return path+"lib/site-packages"
   return "PTVSD not Found"

and change

ptvsd_path = prefs.path

to

ptvsd_path = prefs.path.rstrip('/')

workaround is to manually add path but remove trailing separator when activating plugin.

@AlansCodeLog AlansCodeLog added the bug Something isn't working label May 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants