[issue8582] urllib.urlretrieve fails with ValueError: Invalid format string

2010-05-01 Thread Senthil Kumaran

Senthil Kumaran  added the comment:

Fixed in trunk: r80675
release26-maint: r80676
py3K: r80677
release31-maint:r80678

--
resolution:  -> fixed
stage: unit test needed -> committed/rejected
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8582] urllib.urlretrieve fails with ValueError: Invalid format string

2010-04-30 Thread Senthil Kumaran

Senthil Kumaran  added the comment:

Here is the patch and the unittest for this issue.
David: The tests does ensure coverage of urlretrieve method.

- Changes %T to %H:%M:%S in strftime usage in retrieve.
- Coverage of Date header of retrieved file according to format specified.

David, any comments or any further coverage required?

--
keywords: +patch
Added file: http://bugs.python.org/file17158/issue8582.diff

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8582] urllib.urlretrieve fails with ValueError: Invalid format string

2010-04-30 Thread R. David Murray

Changes by R. David Murray :


--
stage:  -> unit test needed
type: crash -> behavior
versions: +Python 2.6, Python 3.1, Python 3.2

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8582] urllib.urlretrieve fails with ValueError: Invalid format string

2010-04-30 Thread R. David Murray

R. David Murray  added the comment:

The fact that our docs don't mention it is a clue that it is platform dependent 
:)

Theoretically it shouldn't be, since it is in Posix:

  http://www.opengroup.org/onlinepubs/009695399/functions/strftime.html

but practically speaking it is, since Windows doesn't support it:

  http://msdn.microsoft.com/en-us/library/fe06s4ak.aspx

Apparently not all unix/linux platforms support it either:

  
http://stackoverflow.com/questions/2034242/date-and-strftime-not-same-on-windows-and-linux-why

--
nosy: +r.david.murray

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8582] urllib.urlretrieve fails with ValueError: Invalid format string

2010-04-30 Thread Senthil Kumaran

Senthil Kumaran  added the comment:

I guess the problem with specific to Windows. I don't see any problem with 
urlretrieve of a image/png url on Linux.
And surprisingly, %T of time.strftime is undocumented:
http://docs.python.org/library/time.html

I wanted to check if that format specifier was platform specific.

--
components: +Windows

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8582] urllib.urlretrieve fails with ValueError: Invalid format string

2010-04-30 Thread Senthil Kumaran

Changes by Senthil Kumaran :


--
assignee:  -> orsenthil
nosy: +orsenthil

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8582] urllib.urlretrieve fails with ValueError: Invalid format string

2010-04-30 Thread Jason Gross

New submission from Jason Gross :

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 "", line 1, in 
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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com