Eryk Sun <[email protected]> added the comment:
> e = Path(r'F:\ceven\test2')
Using forward slashes in the string literal is preferred, e.g.
Path('F:/ceven/test2'). This avoids the problem of backslash escapes in string
literals. The Path constructor parses the path and stores it internally as
component parts. When the path object is needed as a string, os.fspath()
returns the path using the platform's preferred path separator. A WindowsPath
or PureWindowsPath uses backslash as the path separator. For example:
>>> os.fspath(pathlib.PureWindowsPath('F:/ceven/test2'))
'F:\\ceven\\test2'
----------
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue46916>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com