jupyterlab/jupyterlab

Not consistent output of URLExt.join for Windows / Unix

Open

#10,964 建立於 2021年8月30日

在 GitHub 查看
 (6 留言) (0 反應) (0 負責人)TypeScript (13,454 star) (2,937 fork)batch import
bughelp wantedtrigent: triage

描述

First of all, thank you! I'm using Jupyter almost every day. Thank you!

Description

I'm working on a desktop application that will be notebook with graphical interface to generate python code (it is an electron app). I'm using @jupyterlab/services TS packages in my app.

I have a problem with SessionManager. I got an error: Can only be used for notebook server request. I have this error only on Windows system, on Unix (Ubuntu/MacOS) it works OK.

I debug the error and it looks like there is a problem is with output from URLExt.join method. The example code and outputs below.

import { URLExt } from '@jupyterlab/coreutils';
console.log(URLExt.join('http://127.0.0.1/', 'api/sessions'); 

Output on Unix:

http://127.0.0.1/api/sessions

Output on Windows:

http://127.0.0.1\api\sessions

The @jupyterlab/coreutils version 5.1.8. I would expect to get the same output on Windows as in Unix.

Because of this difference the SessionManager cant run the poll to check sessions (it is getting error because the url of the request doesnt include the baseUrl).

Thank you!

貢獻者指南

Not consistent output of URLExt.join for Windows / Unix · jupyterlab/jupyterlab#10964 | Good First Issue