[issue20164] Undocumented KeyError from os.path.expanduser

2018-12-16 Thread STINNER Victor
STINNER Victor added the comment: Even if it's not exactly a duplicate of bpo-10496, the reported bug has been fixed. I close the issue. -- resolution: -> duplicate stage: test needed -> resolved status: pending -> closed superseder: -> Python startup should not require passwd entry

[issue20164] Undocumented KeyError from os.path.expanduser

2018-12-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The behavior was changed in f2f4555d8287ad217a1dba7bbd93103ad4daf3a8 as a part of issue10496. -- nosy: +serhiy.storchaka, vstinner status: open -> pending ___ Python tracker

[issue20164] Undocumented KeyError from os.path.expanduser

2014-09-30 Thread Chris Adams
Chris Adams added the comment: I agree that making the code match the docs would be preferable – an unexpected KeyError might be easier to track down that way but it'd still surprise most developers. re:pwd docs, the formatting in https://hg.python.org/cpython/file/8e9df3414185/Doc/library/pw

[issue20164] Undocumented KeyError from os.path.expanduser

2014-09-27 Thread Terry J. Reedy
Terry J. Reedy added the comment: I think the doc should be considered correct and posixpath buggy. The ntpath code checks for the existence of HOME and substitutes before returning the arg unchanged, as documented. if 'HOME' in os.environ: userhome = os.environ['HOME'] elif '

[issue20164] Undocumented KeyError from os.path.expanduser

2014-09-27 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- assignee: -> docs@python components: +Documentation nosy: +docs@python stage: -> needs patch versions: +Python 3.5 -Python 3.3 ___ Python tracker _

[issue20164] Undocumented KeyError from os.path.expanduser

2014-01-07 Thread Chris Adams
Chris Adams added the comment: Other than hoisting the warnings import to the top (PEP-8) that seems entirely reasonable to me. The user report which we got was confusing because it was non-obvious where it came from - a warning or other pointer would have helped the original reporter get an i

[issue20164] Undocumented KeyError from os.path.expanduser

2014-01-07 Thread Yury V. Zaytsev
Yury V. Zaytsev added the comment: Amusingly, it's also the case on BG/Q compute nodes. Only this morning, I cooked up the following patch: --- a/Lib/posixpath.py +++ b/Lib/posixpath.py @@ -237,7 +237,11 @@ def expanduser(path): if i == 1: if 'HOME' not in os.environ:

[issue20164] Undocumented KeyError from os.path.expanduser

2014-01-07 Thread Chris Adams
New submission from Chris Adams: This is a more general version of #10496: os.path.expanduser is documented as returning the unmodified string if it cannot be expanded (http://docs.python.org/3/library/os.path.html#os.path.expanduser) but there's one edge case where this can fail: when running