This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eryksun
Recipients eryksun, paul.moore, steve.dower, tim.golden, vincent.fung, zach.ware
Date 2022-03-04.02:30:52
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1646361052.68.0.443397087971.issue46916@roundup.psfhosted.org>
In-reply-to
Content
> 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'
History
Date User Action Args
2022-03-04 02:30:52eryksunsetrecipients: + eryksun, paul.moore, tim.golden, zach.ware, steve.dower, vincent.fung
2022-03-04 02:30:52eryksunsetmessageid: <1646361052.68.0.443397087971.issue46916@roundup.psfhosted.org>
2022-03-04 02:30:52eryksunlinkissue46916 messages
2022-03-04 02:30:52eryksuncreate