Open KapJI opened 9 months ago
Replace os.path.normpath with str(pathlib.Path()) which correctly fixes path separators when UNC path is provided.
os.path.normpath
str(pathlib.Path())
Tested that this code doesn't escape search dir, e.g.:
>>> str(pathlib.Path(posixpath.join("C:\\abc", "e:d\\ef"))) 'C:\\abc\\e:d\\ef' >>> str(pathlib.Path(posixpath.join("\\\\?\\C:\\abc", "e:d\\ef"))) '\\\\?\\C:\\abc\\e:d\\ef'
Checklist:
CHANGES.rst
.. versionchanged::
pre-commit
pytest
tox
Replace
os.path.normpath
withstr(pathlib.Path())
which correctly fixes path separators when UNC path is provided.Tested that this code doesn't escape search dir, e.g.:
Checklist:
CHANGES.rst
summarizing the change and linking to the issue... versionchanged::
entries in any relevant code docs.pre-commit
hooks and fix any issues.pytest
andtox
, no tests failed.