diff -r 6982f460fa6d Doc/library/urllib.request.rst --- a/Doc/library/urllib.request.rst Mon Mar 26 23:35:31 2012 -0400 +++ b/Doc/library/urllib.request.rst Tue Mar 27 19:57:02 2012 +0200 @@ -551,7 +551,7 @@ post-process *protocol* responses. -.. method:: OpenerDirector.open(url, data=None[, timeout]) +.. method:: OpenerDirector.open(url, data=None, timeout=None) Open the given *url* (which can be a request object or a string), optionally passing the given *data*. Arguments, return values and exceptions raised are diff -r 6982f460fa6d Lib/urllib/request.py --- a/Lib/urllib/request.py Mon Mar 26 23:35:31 2012 -0400 +++ b/Lib/urllib/request.py Tue Mar 27 19:57:02 2012 +0200 @@ -449,7 +449,9 @@ if result is not None: return result - def open(self, fullurl, data=None, timeout=socket._GLOBAL_DEFAULT_TIMEOUT): + def open(self, fullurl, data=None, timeout=None): + if timeout is None: + timeout = socket._GLOBAL_DEFAULT_TIMEOUT # accept a URL or a Request object if isinstance(fullurl, str): req = Request(fullurl, data)

AltStyle によって変換されたページ (->オリジナル) /