Path Conversion Issue in pathname2url
Impacts Browser Launch on mingw-w64
#1474
Labels
pathname2url
Impacts Browser Launch on mingw-w64
#1474
Description
When using Jupyter Server on mingw-w64 Python builds, the server fails to open the browser automatically. This issue is traced back to
urllib.request.pathname2url
, which produces malformed URLs when handling Windows paths with forward slashes. The malformed URLs (e.g.,'///C://Users/...
) prevent browsers from recognizing the paths correctly.Steps to Reproduce
mingw-w64-python-jupyter_server
(via MSYS2).Analysis
jupyter_server/jupyter_server/utils.py
Line 28 in e544fa1
jupyter_server/jupyter_server/utils.py
Line 39 in e544fa1
jupyter_server/jupyter_server/serverapp.py
Line 3019 in e544fa1
Also reported on msys2-contrib/cpython-mingw#182
The root cause appears to be a bug in
urllib.request.pathname2url
, which mingw-w64 Python inherits. When converting paths, it doubles the forward slashes after the drive letter (C://
) instead of normalizing to the expected format.Expected Behavior
pathname2url
should produce URLs in the format:This would allow browsers to open correctly, resolving the issue.
Context
The text was updated successfully, but these errors were encountered: