]> granicus.if.org Git - python/commit
netrc will now raise a more predictable exception when $HOME is not set
authorPaul Prescod <prescod@prescod.net>
Mon, 18 Mar 2002 02:13:48 +0000 (02:13 +0000)
committerPaul Prescod <prescod@prescod.net>
Mon, 18 Mar 2002 02:13:48 +0000 (02:13 +0000)
commitb845f3b4dd2074b22eb2915ba4514bd2d5a87769
tree4de27aa725770443af6826fa9c5671bb2dc3cb37
parent10acc8f9e23e8b5afc39041387d768342464e658
netrc will now raise a more predictable exception when $HOME is not set
(as it is often not on Windows). The code was always designed so that it
would raise an IOError if there was no .netrc. But if there was no $HOME
it would return a KeyError which would be somewhat unexpected for code
that didn't know the algorithm it used to find .netrc. The particular
code that triggered this problem for me was ftpmirror.py which handled
the IOError gracefully, but not the KeyError.
Lib/netrc.py