Skip to content

urlib.request has the wrong output? or is jupyter understanding #182

@Kreijstal

Description

@Kreijstal

msys2/MINGW-packages#21139

Bug report

def pathname2url(p):

>>> from urllib.request import pathname2url
>>> pathname2url("C:/Users/kreij/AppData/Roaming/jupyter/runtime/jpserver-18504-open.html")
'///C://Users/kreij/AppData/Roaming/jupyter/runtime/jpserver-18504-open.html'

While the output should be
'//C:/Users/kreij/AppData/Roaming/jupyter/runtime/jpserver-18504-open.html'
With 3 '/' aka file:/// no browser gets launched

On my computer when I open explorer.exe and insert
file:///C://Users/kreij/AppData/Roaming/jupyter/runtime/jpserver-18504-open.html
nothing happens, but when I insert
file://C:/Users/kreij/AppData/Roaming/jupyter/runtime/jpserver-18504-open.html
a browser gets launched

Fixing this would fix the jupyter problem

Your environment

mingw64

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions