Hi,
I just had a strange behavior with app.run() depending on where I call
it.
<pre>
import web
urls = ('/', 'index')
app = web.application(urls, globals())
class index:
def GET(self):
return 'Hello world.'
app.run()
</pre>
raises a
<pre>
File "/Library/Frameworks/Python.framework/Versions/2.6/lib/
python2.6/site-packages/web.py-0.33-py2.6.egg/web/wsgiserver/
__init__.py", line 1596, in start
raise socket.error, msg
error: [Errno 48] Address already in use
</pre>
while the same code, replacing the last line with
<pre>
if __name__ == '__main__':
app.run()
</pre>
runs nicely.
In addition, the first version crashed my Snow Leopard several times
(until I found that I need to use the if main).
I have the same behavior with
- Snow Leopard, Python 2.6.4, web.py 0.33 fresh out from PyPi
- Leopard, Python 2.6.3, web.py 0.31
Thanks,
r.
--
You received this message because you are subscribed to the Google Groups
"web.py" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/webpy?hl=en.