msys2-contrib / cpython-mingw

A friendly fork of CPython which adds support for Mingw-w64 + clang/gcc. See https://github.com/msys2-contrib/cpython-mingw/wiki for details
https://github.com/msys2-contrib/cpython-mingw/wiki
Other
38 stars 12 forks source link

UNC path brokenness #176

Open lazka opened 1 month ago

lazka commented 1 month ago

Two issues:

The last one fails:

$ mkdir -p /tmp/bla
$ touch /tmp/bla/unctest.py
$ python3 -c "import sys; sys.path.insert(0, r'C:/msys64/tmp/bla'); import unctest"
$ python3 -c "import sys; sys.path.insert(0, r'C:\\msys64\\tmp\\bla'); import unctest"
# broken:
$ python3 -c "import sys; sys.path.insert(0, r'\\\\?\\C:\\msys64\\tmp\\bla'); import unctest"
# works
$ MSYSTEM= python3 -c "import sys; sys.path.insert(0, r'\\\\?\\C:\\msys64\\tmp\\bla'); import unctest"

Maybe related:

$ python3 -c "import os; print(os.path.normpath(r'\\\\?\\C:\\msys64\\tmp\\bla'))"
//?/C:/msys64/tmp/bla

We should not normalize paths starting with with \\?\ even if MSYSTEM is set, as that would break them.

Possible related downstream issues: