[issue41026] mailbox does not support new Path object

2021-09-07 Thread Ethan Furman
Ethan Furman added the comment: The problem with using `str()` on a path argument is that the argument may not be a str, nor a pathlib object, but `str()` will still create a string out of it, leading to difficult bugs. The documentation for pathlib also predates the addition of

[issue41026] mailbox does not support new Path object

2020-06-19 Thread శ్రీనివాస్ రెడ్డి తాటిపర్తి
Change by Srinivas Reddy Thatiparthy(శ్రీనివాస్ రెడ్డి తాటిపర్తి) : -- nosy: +thatiparthy nosy_count: 2.0 -> 3.0 pull_requests: +20164 pull_request: https://github.com/python/cpython/pull/20990 ___ Python tracker

[issue41026] mailbox does not support new Path object

2020-06-19 Thread Laurence
Laurence added the comment: I have patched the module to accept a path-like object, however it still follows the pre-pathlib ways of doing things elsewhere. There's quite a bit of work to do to modernise the whole module, but this patch at least adds support to pass a Path to the classes

[issue41026] mailbox does not support new Path object

2020-06-19 Thread Laurence
Change by Laurence : -- keywords: +patch pull_requests: +20153 stage: -> patch review pull_request: https://github.com/python/cpython/pull/20976 ___ Python tracker ___

[issue41026] mailbox does not support new Path object

2020-06-19 Thread Laurence
Laurence 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

[issue41026] mailbox does not support new Path object

2020-06-18 Thread Rémi Lapeyre
Rémi Lapeyre added the comment: Hi Laurence, Maildir predates pathlib so it's not surprising it hasn't been updated yet. Could you open a PR to add this? BTW, you should use os.fspath() instead of str() here. -- nosy: +remi.lapeyre versions: +Python 3.10

[issue41026] mailbox does not support new Path object

2020-06-18 Thread Laurence
Laurence added the comment: Sorry, should read "in particular the Maildir class I'm using"... Same applies to mbox, however. -- ___ Python tracker ___

[issue41026] mailbox does not support new Path object

2020-06-18 Thread Laurence
New submission from Laurence : 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