[issue41026] mailbox does not support new Path object

Laurence report at bugs.python.org
Fri Jun 19 04:42:43 EDT 2020


Laurence <laurence+pythonbugs at entek.org.uk> added the comment:

Hi Rémi,

I understand why it is the case, I just thought it would be a nice enhancement and quick win to add the support.

RE "you should use os.fspath() instead of str()": I'm following in the pathlib docuementation (https://docs.python.org/3/library/pathlib.html):

> The string representation of a path is the raw filesystem path itself (in native form, e.g. with backslashes under Windows), which you can pass to any function taking a file path as a string:
> >>>
> >>> p = PurePath('/etc')
> >>> str(p)
> '/etc'
> >>> p = PureWindowsPath('c:/Program Files')
> >>> str(p)
> 'c:\\Program Files'

Is the pathlib documentation wrong/out-of-date?  I Googled your suggestion of `os.fspath` and found <https://www.python.org/dev/peps/pep-0519/> which reads like the pathlib docs need correcting?

I'm trying to setup a build environment to create a PR for this issue as I type...

Thanks,

Laurence

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41026>
_______________________________________


More information about the Python-bugs-list mailing list