Kaydet (Commit) ed52a20c authored tarafından Guido van Rossum's avatar Guido van Rossum

In open_ftp(), check that retrlen is not None before using it in a %d format!

üst b8c3cbdd
......@@ -387,7 +387,7 @@ class URLopener:
value in ('a', 'A', 'i', 'I', 'd', 'D'):
type = string.upper(value)
(fp, retrlen) = self.ftpcache[key].retrfile(file, type)
if retrlen >= 0:
if retrlen is not None and retrlen >= 0:
import mimetools, StringIO
headers = mimetools.Message(StringIO.StringIO(
'Content-Length: %d\n' % retrlen))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment