2012-06-05, 01:11
(2012-05-31, 20:11)xlotlu Wrote: It works. On the same machine, same python interpreter, even same user, that code works just fine. But under xbmc it fails. It's absolutely mystifying.I have the same problem. I also straced both python interpreter and xbmc:
This started recently, with no reason whatsoever as far as I can tell. Maybe someone has a better idea than me what might be wrong.
I have used "special" script to automatically fetch several pages.
In this example, script connects to https://paypal.com (using urllib2)
python:
http://pastebin.com/LDg0mha9
xbmc:
http://pastebin.com/XyJL6DWf
One difference that might be important:
python:
Code:
15013 close(3) = 0
15013 socket(PF_INET, SOCK_STREAM, IPPROTO_TCP) = 3
15013 connect(3, {sa_family=AF_INET, sin_port=htons(443), sin_addr=inet_addr("173.0.84.35")}, 16) = 0
15013 getpeername(3, {sa_family=AF_INET, sin_port=htons(443), sin_addr=inet_addr("173.0.84.35")}, [16]) = 0
xbmc:
Code:
14998 close(28) = 0
14998 socket(PF_INET, SOCK_STREAM, IPPROTO_TCP) = 28
14998 connect(28, {sa_family=AF_INET, sin_port=htons(443), sin_addr=inet_addr("173.0.88.35")}, 16 <unfinished ...>
14934 <... futex resumed> ) = -1 ETIMEDOUT (Connection timed out)
14934 futex(0x7f121412e238, FUTEX_WAKE_PRIVATE, 1) = 0
14934 read(23, 0x7fffbb05a600, 4112) = -1 EAGAIN (Resource temporarily unavailable)
14934 read(22, 0x7f122c98c000, 4096) = -1 EAGAIN (Resource temporarily unavailable)
There is a little time out.
Can someone tell, why it's there?
I have tested also pycurl, and it worked in python interpreter and xbmc(paypal.com have some unrelated problem)
It might be urllib2 problem. Maybe threading.
Does urllib2 is thread safe?