[Python-checkins] CVS: python/dist/src/Lib ftplib.py,1.60.10.2,1.60.10.3

Michael Hudson mwh@users.sourceforge.net
Mon, 11 Mar 2002 02:20:38 -0800


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

Modified Files:
      Tag: release22-maint
	ftplib.py 
Log Message:
backport loewis' checkin of
    revision 1.66 of ftplib.py

Access the exception argument to see whether it starts with '500'.
Fixes #527855.


Index: ftplib.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/ftplib.py,v
retrieving revision 1.60.10.2
retrieving revision 1.60.10.3
diff -C2 -d -r1.60.10.2 -r1.60.10.3
*** ftplib.py	16 Feb 2002 23:08:24 -0000	1.60.10.2
--- ftplib.py	11 Mar 2002 10:20:36 -0000	1.60.10.3
***************
*** 493,498 ****
                  return self.voidcmd('CDUP')
              except error_perm, msg:
!                 if msg[:3] != '500':
!                     raise error_perm, msg
          elif dirname == '':
              dirname = '.'  # does nothing, but could return error
--- 493,498 ----
                  return self.voidcmd('CDUP')
              except error_perm, msg:
!                 if msg.args[0][:3] != '500':
!                     raise
          elif dirname == '':
              dirname = '.'  # does nothing, but could return error