mirror of
https://github.com/python/cpython.git
synced 2025-10-07 07:31:46 +00:00
Patch # 1331 by Christian Heimes.
The patch fixes some of the problems on Windows. It doesn't introduce addition problems on Linux.
This commit is contained in:
parent
daa251ca09
commit
c12a813aa7
7 changed files with 25 additions and 15 deletions
|
@ -26,9 +26,12 @@ class netrc:
|
|||
file = os.path.join(os.environ['HOME'], ".netrc")
|
||||
except KeyError:
|
||||
raise IOError("Could not find .netrc: $HOME is not set")
|
||||
fp = open(file)
|
||||
self.hosts = {}
|
||||
self.macros = {}
|
||||
with open(file) as fp:
|
||||
self._parse(file, fp)
|
||||
|
||||
def _parse(self, file, fp):
|
||||
lexer = shlex.shlex(fp)
|
||||
lexer.wordchars += r"""!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~"""
|
||||
while 1:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue