joe-greenawalt / skulpt

Automatically exported from code.google.com/p/skulpt
Other
0 stars 0 forks source link

urllib and other modules #78

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Code you're trying to run:
import urllib
x = urllib.urlopen("http://skulpt.org/")
print x
print x.read()

What does "real" Python output?
<addinfourl at 5498040 whose fp = <socket._fileobject object at 0x53d8b0>>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
    <head>
[...]

What browser are you using? On what operating system?
Chrome 8

Please provide any additional information.
Obviously it's getting a little fancy here. It might be good to document a way 
for not-as-privy users like myself to help develop modules like urllib for 
Skulpt. There should probably also be a warning or something printed to 
stderr(whatever that's decided to be) saying that urllib will only work on 
domains that obey the same-origin policy for SJAX (synchronous JAX ;-)).

This precise functionality may also have the prerequisite of having an 
infrastructure for file-reading objects, so maybe another ticket is in order 
for that.

Original issue reported on code.google.com by carnioja...@gmail.com on 2 Feb 2011 at 9:44