First of all,. it is quite fun playing around with this port of Python. I think some people did a hell of a job!
I tried several examples on a real device (the orginal NGage) and emulator and I found out that the weather stuff and my own internet access is not working properly anymore: after working for two times, it somehow does not get to the maps on the internet anymore. When I use the same url in the WAP browser it works fine, so there isn't a problem with the WAP gateway.
I found the solution to the problem. I had not set up a GPRS data account on my phone. I was trying to use either the PXT apn or the VLive! accounts... thinking that these were generic data connections. Using the GPRS data account all the internet examples work fine.
Thanks for answering, but this solution does not work for me..
Let me give some more details:
First I thought by using an supported phone (6600) the problem would disappear... but:
GPRS works, for every address, but NOT within python! When I try to fetch the weathermap or another picture from my own webserver in the wap browser the image is shown, so my conclusion would be that there are no access restrictions concerning my GPRS account (Btw it is a TMobile Holland GPRS PrePaid account)
I found out by removing the try/except block in the weather_maps example that an IOError was raised by line 162 in socket.py. Looking into this code in the emulator oddly enough the source of the exception is gethostbyname...looks some weird is wrong in the e32python.pyd?
So, I thought, let try to grab an image from my own IP address, so the gethostbyname wouldn't get called. No error, it just hangs. When I cancel the GPRS connection/attachment I get the 'Connection timed-out' problem.
Conclusion: I just don't see the obvious solution or something is really wrong...
I also removed the exception handling code and got the same sorts of errors you describe. I also spent some time watching the traffic using the "Conn. Mgr." app on the phone. Even when my apps were hanging they were generating traffic... so it definitely looked like a problem upstream.
I checked out the docs on my service providers web site (www.vodafone.co.nz) and discovered that i was missing the generic internet connection settings. The key difference between that connection and the other two was the name of the access point (it also sets the 'Authentication' to secure where the other two connections have it set to 'Normal').
Again, I find it a bit weird that a J2ME midlet and the WAP browser can get anything from the internet, while the python is hanging.. but I believe/hope this problem will be solved soon. In the meantime I was working on a NMEA parser and a Bluetooth GPS: it just works after only two hours fooling around with some code.. Really cool, being a teacher I had a student doing some C++ symbian BT stuff and after two weeks it still doesn't work ;-(
Flash5standingby: thanks for answering, again, probably something stupid is wrong at Tmobile or they changed some settings.. time will tell.
Finally, the problem is solved and the solution is simple: indeed, use a generic internet access point.
It turned to be that TMobile Holland stopped their general internet access for prepaid users (that's why I thought J2ME was still working, but it didn't ..) and Vodafone never had it. After some consultation I found out that an other dutch provider, Orange, offers a special internet access bundle...