summaryrefslogtreecommitdiffstats
path: root/Lib/ftplib.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2001-10-17 17:21:47 (GMT)
committerGuido van Rossum <guido@python.org>2001-10-17 17:21:47 (GMT)
commit1f74cb3575a51879bc7a011757958607d18e0bce (patch)
treefbe68d1900adf147ecbec586f0220f5991f727b7 /Lib/ftplib.py
parent14a6f8378e3b2a00e0cfd0a3853cddaaf56af727 (diff)
downloadcpython-1f74cb3575a51879bc7a011757958607d18e0bce.zip
cpython-1f74cb3575a51879bc7a011757958607d18e0bce.tar.gz
cpython-1f74cb3575a51879bc7a011757958607d18e0bce.tar.bz2
Oops. Catching OverflowError from int() doesn't help, since it raises
ValueError on too-large inputs.
Diffstat (limited to 'Lib/ftplib.py')
-rw-r--r--Lib/ftplib.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/ftplib.py b/Lib/ftplib.py
index 8d8d51f..592f5d2 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)