[New-bugs-announce] [issue22570] Better stdlib support for Path objects

Barry A. Warsaw report at bugs.python.org
Mon Oct 6 17:33:51 CEST 2014

New submission from Barry A. Warsaw:

pathlib is really nice, but currently it's rather inconvenient to use due to the lack of support in other parts of the stdlib for Path objects.  For historical reasons, everything accepts string paths, but few places accept Paths.  As an example: configparser.ConfigParser.read() but there are lots of others.

I'm opening this bug to start a conversation about better support for Path objects in the stdlib.  Against all hope, I wish there was a simple way to extend the compatibility, but I don't like having to sprinkle `str(some_path)` calls everywhere (kind of defeats the purpose of having the nicer pathlib API IMHO).  I suspect instead that it will be a matter of adding type tests or str() conversions to the relevant methods, but there may be other issues to discuss, like is it even a good idea to do this? ;)

messages: 228704
nosy: barry
priority: normal
severity: normal
status: open
title: Better stdlib support for Path objects
versions: Python 3.5

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list