]> granicus.if.org Git - python/commitdiff
SF 557704: netrc module can't handle all passwords
authorRaymond Hettinger <python@rcn.com>
Wed, 23 Apr 2003 18:59:54 +0000 (18:59 +0000)
committerRaymond Hettinger <python@rcn.com>
Wed, 23 Apr 2003 18:59:54 +0000 (18:59 +0000)
Expanded the range of allowable characters to include ascii punctuation.
Allows resource files to have a larger character set for passwords.
(Idea contributed by Bram Moolenaar.)

Lib/netrc.py

index 316a66c8867db8f5a90999ec4edb09c6d02e7fd7..1d65dbeb895bf43091e86b50958c279458f237e1 100644 (file)
@@ -30,8 +30,7 @@ class netrc:
         self.hosts = {}
         self.macros = {}
         lexer = shlex.shlex(fp)
-        # Allows @ in hostnames.  Not a big deal...
-        lexer.wordchars = lexer.wordchars + '.-@'
+        lexer.wordchars += r"""!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~"""
         while 1:
             # Look for a machine, default, or macdef top-level keyword
             toplevel = tt = lexer.get_token()