This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ethan.furman
Recipients Antony.Lee, brett.cannon, eryksun, ethan.furman, serhiy.storchaka, vstinner
Date 2020-01-27.21:26:45
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1580160406.15.0.892278786256.issue39461@roundup.psfhosted.org>
In-reply-to
Content
The idea behind PEP 519 was to alleviate str(path_obj) calls between the os/program interface.  We can either make that as consistent as we can as we find places that still require the str(path_obj) idiom, or we can make users remember which ones do, and which ones don't, easily use a Path object.

In my opinion, having to remember is a very unpleasant and frustrating user experience.

Serhiy Storchaka:
----------------
> Path-like objects are now unintentionally accepted for many non-path
> things, like hostname in socket.sethostname() and username in
> os.initgroups(). I also think it was a mistake, and we should not
> make new mistakes.

There will always be ways for users to make mistakes when using API's.  Whether they passed a Path path to os.sethostname() or a string path to os.sethostbyname(), it's still their bug, and linters/type-checkers exist to help catch those kinds of bugs.

Brett Canon:
-----------
> Environment variables are strings, period, so they should be specified
> as such;

Out of curiosity, any idea how often non-strings are used to set os.environ, and so need explicit conversion?
History
Date User Action Args
2020-01-27 21:26:46ethan.furmansetrecipients: + ethan.furman, brett.cannon, vstinner, serhiy.storchaka, Antony.Lee, eryksun
2020-01-27 21:26:46ethan.furmansetmessageid: <1580160406.15.0.892278786256.issue39461@roundup.psfhosted.org>
2020-01-27 21:26:46ethan.furmanlinkissue39461 messages
2020-01-27 21:26:45ethan.furmancreate