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.
Created on 2013年11月25日 20:04 by pitrou, last changed 2022年04月11日 14:57 by admin. 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) * (Python committer) | 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) * (Python committer) | 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) * (Python committer) | 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) * (Python committer) | Date: 2015年01月06日 11:46 | |
I agree that Path.home() is more user friendly than Path.expanduser('~').
|
|||
| msg233887 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | 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) (Python triager) | 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) * (Python committer) | Date: 2015年01月13日 00:48 | |
I've committed the patch, thank you! |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:54 | admin | set | github: 63976 |
| 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 | |