URLTimeout: Please help

24 views
Skip to first unread message

Kevin Glover

unread,
Jul 7, 2014, 6:42:58 AM7/7/14
to pattern-f...@googlegroups.com
I am using pattern to parse a text, list all of the nouns, then carry out a series of phrase searches on Wikipedia for each noun, and return the results count for each phrase search. This works very well - some of the time. But I keep getting a URLTimeout message (the internet connection speed here is very slow).

I know that I can import URLTimeout, but I am not sure how to write the code that will increase the timeout value and stop my program crashing all the time.

Thanks.

Kevin

Francis Nimick

unread,
Jul 8, 2014, 10:27:00 AM7/8/14
to pattern-f...@googlegroups.com
I looked at your earlier stacktrace.  In your call to .search(), you can set timeout=<something> as an additional keyword argument.  It defaults to 10.  Try with a higher value and see if that helps.

Francis


--

---
You received this message because you are subscribed to the Google Groups "Pattern" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pattern-for-pyt...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Kevin Glover

unread,
Jul 9, 2014, 9:44:02 AM7/9/14
to pattern-f...@googlegroups.com
Thanks, Francis. Things are so simple, if only you know how!

All the best.

Kevin


--

---
You received this message because you are subscribed to a topic in the Google Groups "Pattern" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pattern-for-python/A9AjnEyvWHM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pattern-for-pyt...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages