Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1f74cb3

Browse files
committed
Oops. Catching OverflowError from int() doesn't help, since it raises
ValueError on too-large inputs.
1 parent 14a6f83 commit 1f74cb3

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Lib/ftplib.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ def size(self, filename):
508508
s = resp[3:].strip()
509509
try:
510510
return int(s)
511-
except OverflowError:
511+
except (OverflowError, ValueError):
512512
return long(s)
513513

514514
def mkd(self, dirname):
@@ -558,7 +558,7 @@ def parse150(resp):
558558
s = m.group(1)
559559
try:
560560
return int(s)
561-
except OverflowError:
561+
except (OverflowError, ValueError):
562562
return long(s)
563563

564564

0 commit comments

Comments
 (0)