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

Import escapes path names incorrectly #3450

Closed
rchiodo opened this issue Apr 19, 2019 · 0 comments
Closed

Import escapes path names incorrectly #3450

rchiodo opened this issue Apr 19, 2019 · 0 comments
Assignees

Comments

@rchiodo
Copy link
Contributor

rchiodo commented Apr 19, 2019

Import an ipynb that's not in the root. You end up with this:

#%% Change working directory from the workspace root to the ipynb file location. Turn this addition off with the DataScience.changeDirOnImportExport setting
import os
try:
	os.chdir(os.path.join(os.getcwd(), 'exercisefiles\05\demos\demo\titanic\notebooks'))
	print(os.getcwd())
except:
	pass

That should be an escaped path. The '' are single.

If you run it, you get this:

os.chdir(os.path.join(os.getcwd(), 'exercisefiles\05\demos\demo\titanic\notebooks'))

WindowsErrorTraceback (most recent call last)
in ()
----> 1 os.chdir(os.path.join(os.getcwd(), 'exercisefiles\05\demos\demo\titanic\notebooks'))

WindowsError: [Error 123] The filename, directory name, or volume label syntax is incorrect: 'd:\Training\DoingDataScienceWithPython\exercisefiles\x05\demos\demo\titanic\notebooks'

@rchiodo rchiodo self-assigned this May 24, 2019
@rchiodo rchiodo closed this as completed Aug 6, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Aug 14, 2019
@microsoft microsoft unlocked this conversation Nov 14, 2020
@DonJayamanne DonJayamanne transferred this issue from microsoft/vscode-python Nov 14, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 7, 2021
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

1 participant