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 2012年05月10日 02:25 by bfroehle, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| issue_14768.patch | bfroehle, 2012年05月10日 02:50 | review | ||
| Messages (4) | |||
|---|---|---|---|
| msg160321 - (view) | Author: Bradley Froehle (bfroehle) * | Date: 2012年05月10日 02:25 | |
When $HOME=/, os.path.expanduser('~/a') returns '//a' rather than '/a'.
This regression was created by a partially incorrect resolution to issue #5471, and affects versions 2.7 and 3.2 (at least).
$ HOME=/ python2.7 -c "import os; print os.path.expanduser('~/a')"
//a
$ HOME=/ python3.2 -c "import os; print(os.path.expanduser('~/a'))"
//a
In each case the expected result should be '/a'.
|
|||
| msg160324 - (view) | Author: Jesús Cea Avión (jcea) * (Python committer) | Date: 2012年05月10日 02:48 | |
I though that this situation would be happen for ANY env with $HOME ending in "/", but it is not the case: """ jcea@ubuntu:~$ echo $HOME /home/jcea jcea@ubuntu:~$ python Python 2.7.3 (default, Apr 12 2012, 13:11:53) [GCC 4.4.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import os >>> os.path.expanduser("~/a") '/home/jcea/a' jcea@ubuntu:/home/jcea$ export HOME=/home/jcea/ jcea@ubuntu:/home/jcea$ echo $HOME /home/jcea/ jcea@ubuntu:/home/jcea$ python Python 2.7.3 (default, Apr 12 2012, 13:11:53) [GCC 4.4.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import os >>> os.path.expanduser("~/a") '/home/jcea/a' """ Bradley, would you mind to write a patch & test? |
|||
| msg160325 - (view) | Author: Bradley Froehle (bfroehle) * | Date: 2012年05月10日 02:50 | |
Patch (for version 2.7) attached. |
|||
| msg160326 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2012年05月10日 03:16 | |
New changeset e472481b6d73 by Jesus Cea in branch '3.2': Closes #14768: os.path.expanduser('~/a') doesn't works correctly when HOME is '/' http://hg.python.org/cpython/rev/e472481b6d73 New changeset 299dc54ad014 by Jesus Cea in branch '2.7': Closes #14768: os.path.expanduser('~/a') doesn't works correctly when HOME is '/' http://hg.python.org/cpython/rev/299dc54ad014 New changeset ce39a4ec2906 by Jesus Cea in branch 'default': MERGE: Closes #14768: os.path.expanduser('~/a') doesn't works correctly when HOME is '/' http://hg.python.org/cpython/rev/ce39a4ec2906 |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:30 | admin | set | github: 58973 |
| 2012年05月10日 03:16:59 | python-dev | set | status: open -> closed nosy: + python-dev messages: + msg160326 resolution: fixed stage: resolved |
| 2012年05月10日 03:00:36 | jcea | set | assignee: jcea |
| 2012年05月10日 02:50:34 | bfroehle | set | files:
+ issue_14768.patch keywords: + patch messages: + msg160325 |
| 2012年05月10日 02:48:44 | jcea | set | keywords: + easy |
| 2012年05月10日 02:48:31 | jcea | set | nosy:
+ jcea messages: + msg160324 versions: + Python 3.3 |
| 2012年05月10日 02:25:19 | bfroehle | create | |