[Toolserver-l] Announcement - XSaLT: XSL/XSLT Simple and Lightweight Tool

Merlijn van Deen valhallasw at arctus.nl
Sun Sep 11 21:29:18 UTC 2011


On 11 September 2011 22:59, Platonides <platonides at gmail.com> wrote:

> Also, I'm not sure if urllib.open() works with file:// urls, but I'd
> verify it's a http or https url .
>
>
It even works without. For urllib2, you do need to use file:// urls.

valhallasw at dorthonion:~$ python
Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56)
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import urllib, urllib2
>>> urllib.urlopen('/etc/passwd').readlines()
['root:x:0:0:root:/root:/bin/bash\n', (...) ,'usbmux:x:109:46:usbmux
daemon,,,:/home/usbmux:/bin/false\n']
>>> urllib2.urlopen('file:///etc/passwd').readlines()
['root:x:0:0:root:/root:/bin/bash\n', (...)

Of course, it all boils back to the old motto 'never trust user input' - and
be sure standard libraries are not more general than you think...

(and this is something that might have bitten more of us, including me :-))

Best,
Merlijn
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.wikimedia.org/pipermail/toolserver-l/attachments/20110911/6cd184a2/attachment.htm 


More information about the Toolserver-l mailing list