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 idea as to what was failing earlier.
The other two changes I'd suggest would be documentation updates: os.path.expanduser noting that KeyError may be raised when HOME is undefined and pwd.getpwuid fails for the active user pwd.getpwuid noting that KeyErrors will be raised when the underlying POSIX call fails ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue20164> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com