New submission from Laurence <laurence+pythonb...@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 <rep...@bugs.python.org>
<https://bugs.python.org/issue41026>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

  • ... Laurence
    • ... Laurence
    • ... Rémi Lapeyre
    • ... Laurence
    • ... Laurence
    • ... Laurence
    • ... శ్రీనివాస్ రెడ్డి తాటిపర్తి

Reply via email to