From: Guido van Rossum Date: Wed, 17 Oct 2001 17:21:47 +0000 (+0000) Subject: Oops. Catching OverflowError from int() doesn't help, since it raises X-Git-Tag: v2.2.1c1~1214 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1f74cb3575a51879bc7a011757958607d18e0bce;p=python Oops. Catching OverflowError from int() doesn't help, since it raises ValueError on too-large inputs. --- diff --git a/Lib/ftplib.py b/Lib/ftplib.py index 8d8d51fa82..592f5d29d2 100644 --- a/Lib/ftplib.py +++ b/Lib/ftplib.py @@ -508,7 +508,7 @@ class FTP: s = resp[3:].strip() try: return int(s) - except OverflowError: + except (OverflowError, ValueError): return long(s) def mkd(self, dirname): @@ -558,7 +558,7 @@ def parse150(resp): s = m.group(1) try: return int(s) - except OverflowError: + except (OverflowError, ValueError): return long(s)