Eryk Sun <eryk...@gmail.com> 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 <rep...@bugs.python.org>
<https://bugs.python.org/issue46916>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to