Fix bugs in selecting a system version of Python for Notebook dependencies (#6250)

This commit is contained in:
Cory Rivera
2019-07-03 12:51:48 -07:00
committed by GitHub
parent a8b3f056a0
commit 4189e761ff
3 changed files with 83 additions and 42 deletions

View File

@@ -118,7 +118,18 @@ export class LocalJupyterServerManager implements nb.ServerManager, vscode.Dispo
// /path2/nb3.ipynb
// ... will result in 2 notebook servers being started, one for /path1/ and one for /path2/
let notebookDir = this.apiWrapper.getWorkspacePathFromUri(vscode.Uri.file(this.documentPath));
notebookDir = notebookDir || path.dirname(this.documentPath);
if (!notebookDir) {
let docDir = path.dirname(this.documentPath);
if (docDir === '.') {
// If the user is using a system version of python, then
// '.' will try to create a notebook in a system directory.
// Since this will fail due to permissions, use the user's
// home folder instead.
notebookDir = utils.getUserHome();
} else {
notebookDir = docDir;
}
}
// TODO handle notification of start/stop status
// notebookContext.updateLoadingMessage(localizedConstants.msgJupyterStarting);