You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Error handling and documentation of Path.home() #85254
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=<Date2021-09-08.17:28:49.896>created_at=<Date2020-06-22.21:13:41.917>labels= ['type-bug', 'library', '3.9']
title='Error handling and documentation of Path.home()'updated_at=<Date2021-09-08.17:28:49.896>user='https://github.com/timhoffm'
In current dev version (3.11), _PosixFlavor doesn't have gethomedir(), and instead os.path.expanduser() is used via _NormalAccessor(). So at least for the current dev version, the docs are accurate.
I looked a bit more into this, it's been fixed in 3.10, in this PR: #18841
It wasn't backported to 3.9. I'm not quite sure if it's best to backport to 3.9 or fix via docs for 3.9. Just in case I've put up a small PR for such a docfix.
Using os.path.expanduser is a functional change so it wasn't backported at the time to 3.9 and sure shouldn't be backported now. Going with a doc update is the right approach.
New changeset dc2e11e by andrei kulakov in branch '3.9':
[3.9] bpo-41082: Add note on errors that may be raised by home() and expanduser() (GH-28186) dc2e11e
Behavior is fixed in Python 3.10+. For Python 3.9 the docs are updated to list possible exceptions. Since this was reported with 3.9 in mind, I'm marking this one as wontfix.
Activity
timhoffm commentedon Jun 22, 2020
Path.home() may fail un
(matplotlib/matplotlib#17707 (comment)).
akulakov commentedon Aug 14, 2021
In current dev version (3.11), _PosixFlavor doesn't have gethomedir(), and instead os.path.expanduser() is used via _NormalAccessor(). So at least for the current dev version, the docs are accurate.
akulakov commentedon Sep 6, 2021
I looked a bit more into this, it's been fixed in 3.10, in this PR: #18841
It wasn't backported to 3.9. I'm not quite sure if it's best to backport to 3.9 or fix via docs for 3.9. Just in case I've put up a small PR for such a docfix.
ambv commentedon Sep 8, 2021
Using
os.path.expanduseris a functional change so it wasn't backported at the time to 3.9 and sure shouldn't be backported now. Going with a doc update is the right approach.ambv commentedon Sep 8, 2021
New changeset dc2e11e by andrei kulakov in branch '3.9':
[3.9] bpo-41082: Add note on errors that may be raised by home() and expanduser() (GH-28186)
dc2e11e
ambv commentedon Sep 8, 2021
Behavior is fixed in Python 3.10+. For Python 3.9 the docs are updated to list possible exceptions. Since this was reported with 3.9 in mind, I'm marking this one as wontfix.
Thanks for picking this up, Andrei! ✨ 🍰 ✨