New submission from Jason Gross <jasongro...@gmail.com>:

When calling urllib.urlretrieve with a data:image/png url (possibly with other 
urls too) and a local file name, it fails with
Traceback (most recent call last):
  File "<pyshell#0>", line 1, in <module>
    urlretrieve(url, file_name)
  File "D:\Python26\Lib\urllib.py", line 93, in urlretrieve
    return _urlopener.retrieve(url, filename, reporthook, data)
  File "D:\Python26\Lib\urllib.py", line 237, in retrieve
    fp = self.open(url, data)
  File "D:\Python26\Lib\urllib.py", line 205, in open
    return getattr(self, name)(url)
  File "D:\Python26\Lib\urllib.py", line 596, in open_data
    time.gmtime(time.time())))

This can be fixed by replacing %T on line 595 with %H : %M : %S (which I found 
as the definition of %T on 
http://www.opengroup.org/onlinepubs/009695399/functions/strftime.html)

----------
components: Library (Lib)
messages: 104664
nosy: Jason.Gross
priority: normal
severity: normal
status: open
title: urllib.urlretrieve fails with ValueError: Invalid format string
type: crash
versions: Python 2.7

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue8582>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to