[Python-checkins] python/dist/src/Lib netrc.py,1.17,1.18

rhettinger@users.sourceforge.net rhettinger@users.sourceforge.net
Thu, 24 Apr 2003 13:11:24 -0700


Update of /cvsroot/python/python/dist/src/Lib
In directory sc8-pr-cvs1:/tmp/cvs-serv6358

Modified Files:
	netrc.py 
Log Message:
SF bug 557704: netrc module can't handle all passwords

Let netrc handle entries with login fields (mail servers for instance)
by having login default to ''.

Backport candidate.


Index: netrc.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/netrc.py,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** netrc.py	23 Apr 2003 18:59:54 -0000	1.17
--- netrc.py	24 Apr 2003 20:11:20 -0000	1.18
***************
*** 57,61 ****
  
              # We're looking at start of an entry for a named machine or default.
!             login = account = password = None
              self.hosts[entryname] = {}
              while 1:
--- 57,62 ----
  
              # We're looking at start of an entry for a named machine or default.
!             login = ''
!             account = password = None
              self.hosts[entryname] = {}
              while 1:
***************
*** 63,67 ****
                  if (tt=='' or tt == 'machine' or
                      tt == 'default' or tt =='macdef'):
!                     if login and password:
                          self.hosts[entryname] = (login, account, password)
                          lexer.push_token(tt)
--- 64,68 ----
                  if (tt=='' or tt == 'machine' or
                      tt == 'default' or tt =='macdef'):
!                     if password:
                          self.hosts[entryname] = (login, account, password)
                          lexer.push_token(tt)