[New-bugs-announce] [issue41026] mailbox does not support new Path object

Laurence report at bugs.python.org
Thu Jun 18 12:45:48 EDT 2020


New submission from Laurence <laurence+pythonbugs at entek.org.uk>:

The mailbox library, in particular the Mailbox class I'm using, does not support the new Path object requiring a clumsy `mbx = Maildir(str(some_path_obj))` to use with a Path instance.

It currently blows up if passed a Path directly (does not support startswith) - perhaps a simple solution is to coerce whatever is passed into a string inside `__init__`?

Could this support be added?

I feel that strings representing paths should be discouraged as a general principal now we have a truly portable object to represent paths, and supporting Path in all places it makes logical sense (without breaking backwards compatibility, if implemented as I suggest with coercion by `str(...)` inside the module) in the core library seems like a good thing to me.

----------
components: Library (Lib)
messages: 371823
nosy: LimaAlphaHotel
priority: normal
severity: normal
status: open
title: mailbox does not support new Path object
type: enhancement

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


More information about the New-bugs-announce mailing list