Created on 2013-11-25 20:04 by pitrou, last changed 2015-01-13 00:48 by pitrou. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| path_home.patch | mcsalgado, 2015-01-01 17:20 | review | ||
| path_home2.patch | mcsalgado, 2015-01-01 18:43 | review | ||
| home.patch | oquanox, 2015-01-04 08:58 | review | ||
| Messages (8) | |||
|---|---|---|---|
| msg204388 - (view) | Author: Antoine Pitrou (pitrou) * | Date: 2013-11-25 20:04 | |
Similar to Path.cwd(), perhaps a Path.home() to create a new Path object pointing to the current user's home directory may be useful. |
|||
| msg204459 - (view) | Author: Charles-François Natali (neologix) * | Date: 2013-11-26 07:56 | |
IMO, this functionality is subsumed by http://bugs.python.org/issue19776 (Path.expanduser). |
|||
| msg225246 - (view) | Author: Antoine Pitrou (pitrou) * | Date: 2014-08-12 23:41 | |
> IMO, this functionality is subsumed by http://bugs.python.org/issue19776 Roughly, yes, but it can also be a useful convenience (expanduser('~') isn't that user-friendly, especially for Windows users). |
|||
| msg233403 - (view) | Author: Mayank Tripathi (oquanox) * | Date: 2015-01-04 08:58 | |
Added docs to mcsalgado's patch. |
|||
| msg233528 - (view) | Author: STINNER Victor (vstinner) * | Date: 2015-01-06 11:46 | |
I agree that Path.home() is more user friendly than Path.expanduser('~').
|
|||
| msg233887 - (view) | Author: STINNER Victor (vstinner) * | Date: 2015-01-12 20:55 | |
+ def _test_home(self, p):
+ q = self.cls(os.path.expanduser('~'))
+ self.assertEqual(p, q)
+ self.assertEqual(str(p), str(q))
+ self.assertIs(type(p), type(q))
+ self.assertTrue(p.is_absolute())
+
+ def test_home(self):
+ p = self.cls.home()
+ self._test_home(p)
Why are you using a submethod _test_home()?
|
|||
| msg233888 - (view) | Author: Roundup Robot (python-dev) | Date: 2015-01-12 21:24 | |
New changeset 4a55b98314cd by Antoine Pitrou in branch 'default': Issue #19777: Provide a home() classmethod on Path objects. https://hg.python.org/cpython/rev/4a55b98314cd |
|||
| msg233898 - (view) | Author: Antoine Pitrou (pitrou) * | Date: 2015-01-13 00:48 | |
I've committed the patch, thank you! |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2015-01-13 00:48:28 | pitrou | set | status: open -> closed resolution: fixed messages: + msg233898 stage: needs patch -> resolved |
| 2015-01-12 21:24:23 | python-dev | set | nosy:
+ python-dev messages: + msg233888 |
| 2015-01-12 20:55:06 | vstinner | set | messages: + msg233887 |
| 2015-01-06 11:46:26 | vstinner | set | nosy:
+ vstinner messages: + msg233528 |
| 2015-01-04 08:58:33 | oquanox | set | files:
+ home.patch nosy: + oquanox messages: + msg233403 |
| 2015-01-01 18:43:19 | mcsalgado | set | files: + path_home2.patch |
| 2015-01-01 17:28:23 | artifex93 | set | nosy:
+ artifex93 |
| 2015-01-01 17:20:10 | mcsalgado | set | files:
+ path_home.patch keywords: + patch |
| 2015-01-01 12:09:58 | pitrou | set | keywords:
+ easy stage: needs patch |
| 2014-11-14 00:32:20 | martin.panter | set | nosy:
+ martin.panter |
| 2014-08-12 23:41:32 | pitrou | set | nosy:
+ serhiy.storchaka messages: + msg225246 |
| 2013-11-26 07:56:24 | neologix | set | nosy:
+ neologix messages: + msg204459 |
| 2013-11-26 02:29:49 | Arfrever | set | nosy:
+ Arfrever |
| 2013-11-25 20:04:23 | pitrou | create | |