urllib2 opener hangs if run inside a thread

前端 未结 1 1821
伪装坚强ぢ
伪装坚强ぢ 2021-01-26 01:34

I have a code that is running fine (connect to a page , get PHPSESSID) . when i put that code in a function , then made a thread of it :

Gdk.threads_enter()
thre         


        
相关标签:
1条回答
  • 2021-01-26 02:20

    Okay, I just repost the comment here so that the question can get solved.

    As has been mentioned on other posts regarding pygtk and threading, several hang-behaviours that seem strange appears to be related to not having implemented the following line:

    gobject.threads_init()
    

    Before calling the gtk main-loop. Note though that it has been reported on other questions here on stackoverflow that this solution may or may not work for Windows.

    0 讨论(0)
提交回复
热议问题