Roundup Robot added the comment:
New changeset 63dac5212552 by Victor Stinner in branch 'default':
Issue #19776: Fix test_pathlib.test_expanduser()
https://hg.python.org/cpython/rev/63dac5212552
--
___
Python tracker rep...@bugs.python.org
STINNER Victor added the comment:
Ok, test_pathlib now pass on the buildbot PPC64 AIX 3.x. I close the issue.
Nice enhancement of the Path object.
--
resolution: - fixed
status: open - closed
___
Python tracker rep...@bugs.python.org
Antoine Pitrou added the comment:
Victor, your patch sounds ok to me.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19776
___
___
STINNER Victor added the comment:
The test fails on the buildbot PPC64 AIX 3.x. It looks like the home
directory of the buildbot slave user is /home/shager/.
http://buildbot.python.org/all/builders/PPC64%20AIX%203.x/builds/2994/steps/test/logs/stdio
Antoine Pitrou added the comment:
I don't really know how to investigate that failure. Perhaps David wants to
look into it?
--
nosy: +David.Edelsohn
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19776
STINNER Victor added the comment:
I don't really know how to investigate that failure.
I don't think that it's specific to AIX, it just depends on the list of users
on your system. On my Fedora 21, I have many users which have an empty home
directory:
- nobody
- dbus
- polkitd
- usbmuxd
-
Roundup Robot added the comment:
New changeset bee697b0fd18 by Antoine Pitrou in branch 'default':
Issue #19776: Add a expanduser() method on Path objects.
https://hg.python.org/cpython/rev/bee697b0fd18
--
nosy: +python-dev
___
Python tracker
Changes by Antoine Pitrou pit...@free.fr:
--
resolution: - fixed
stage: patch review - resolved
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19776
___
Changes by Antoine Pitrou pit...@free.fr:
--
nosy: +steve.dower, zach.ware
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19776
___
___
Antoine Pitrou added the comment:
Steve, would you like to give an opinion on the Windows aspects of this patch?
Otherwise I will simply commit it soon.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19776
Steve Dower added the comment:
I thought that USERPROFILE was the preferred environment variable and should be
checked before HOME, but I could be wrong. Consistency with the existing
expanduser function is more important probably.
There's almost certainly an API to find an arbitrary user
Changes by Chris Rebert pyb...@rebertia.com:
--
nosy: +cvrebert
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19776
___
___
Python-bugs-list
Antoine Pitrou added the comment:
Serhiy, would you like to update your patch?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19776
___
___
Serhiy Storchaka added the comment:
Sorry. Here is updated patch.
--
Added file: http://bugs.python.org/file36669/pathlib_expanduser_2.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19776
Claudiu Popa added the comment:
Here's a version of the patch which raises ValueError when the path can't be
expanded. Hopefully, the used approach is good enough.
--
Added file: http://bugs.python.org/file36102/issue19776_4.patch
___
Python tracker
Serhiy Storchaka added the comment:
Here is alternative patch which doesn't use os.path.expanduser() and
reimplement it's logic. Differences:
* expanduser() is part of concrete path API. This method access environment.
* RuntimeError is raised when user home can't be determined.
* Currently
Claudiu Popa added the comment:
Looks good.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19776
___
___
Python-bugs-list mailing list
Charles-François Natali added the comment:
There is a question. What should pathlib's expanduser() do in case
when user directory can't be determined (or user does not exist)?
Perhaps unlike to os.path.expanduser() it should raise an exception
(as in many other pathlib's methods).
Let's see
Claudiu Popa added the comment:
No, my home directory is actually /root. The attached patch should be clearer
now (I hope). Regarding your question, wouldn't checking for this duplicate
what os.path.expanduser already does? (Unless checking for the exact same
string before returning it.)
Claudiu Popa added the comment:
Since all the comments have been addressed, it would be nice if this gets
committed.
--
stage: patch review - commit review
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19776
Claudiu Popa added the comment:
This new patch fixes some comments from Serhiy. Thanks for the review!
--
stage: commit review - patch review
Added file: http://bugs.python.org/file35955/issue19776_2.patch
___
Python tracker rep...@bugs.python.org
Serhiy Storchaka added the comment:
Doc example is still looks confusing. Is your home directory /home?
There is a question. What should pathlib's expanduser() do in case when user
directory can't be determined (or user does not exist)? Perhaps unlike to
os.path.expanduser() it should raise
Claudiu Popa added the comment:
Attached the new version of the patch with fixes according to Antoine's review.
--
Added file: http://bugs.python.org/file35666/issue19776_1.patch
___
Python tracker rep...@bugs.python.org
Claudiu Popa added the comment:
Antoine, how does my latest patch look?
--
stage: - patch review
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19776
___
Antoine Pitrou added the comment:
Claudiu, sorry for the delay. I'm going to take a look soon!
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19776
___
Claudiu.Popa added the comment:
Added a new version of the patch with improvements suggested by Berker Peksag.
Thanks for the review!
--
Added file: http://bugs.python.org/file35237/issue19776.patch
___
Python tracker rep...@bugs.python.org
Antoine Pietri added the comment:
I think that `absolute` method should call `expanduser` and `expandvars` (do
you plan to include it?) automatically. This should be optional (via default
arguments: `expanduser=True, expandvars=True`.
I think it shouldn't. (Or shouldn't be set to True by
Roman Inflianskas added the comment:
I think that `absolute` method should call `expanduser` and `expandvars` (do
you plan to include it?) automatically. This should be optional (via default
arguments: `expanduser=True, expandvars=True`.
--
nosy: +rominf
Fletcher Tomalty added the comment:
+1
It's very annoying to have to import expand user from os.path, when pathlib
should be a full replacement for that module. Thanks to those working on this!
--
nosy: +fletom
___
Python tracker
Claudiu.Popa added the comment:
Antoine, is this feature still wanted?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19776
___
___
Claudiu.Popa added the comment:
Thanks, Vajrasky! Here's the new version of the patch.
--
Added file: http://bugs.python.org/file32980/pathlib1.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19776
Vajrasky Kok added the comment:
Documentation, please (Doc/library/pathlib.rst)!
This is the docstring of Path.cwd.
Return a new path pointing to the current working directory
(as returned by os.getcwd()).
This is the docstring of Path.expanduser.
Return a new path with expanded ~ and ~user
Claudiu.Popa added the comment:
Hello. Here's a patch for `expanduser()`.
--
keywords: +patch
nosy: +Claudiu.Popa
Added file: http://bugs.python.org/file32919/pathlib.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19776
STINNER Victor added the comment:
I wanted to suggest to modify the resolve() method, but '~' is a valid
filename... (I tested, and it's annoying because depending on command,
sometimes ~ is expanded to /home/haypo sometimes not...)
--
nosy: +haypo
New submission from Antoine Pitrou:
Something like expanduser() may be useful on Path objects.
--
components: Library (Lib)
messages: 204387
nosy: pitrou
priority: low
severity: normal
status: open
title: Provide expanduser() on Path objects
type: enhancement
versions: Python 3.5
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:
--
nosy: +Arfrever
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19776
___
36 matches
Mail list logo