By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,662 Members | 1,052 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,662 IT Pros & Developers. It's quick & easy.

AttributeError: 'module' object has no attribute 'setdefaulttimeout'

P: n/a
I get those errors when I run:
/usr/local/bin/SquidClamAV_Redirector.py -c
/etc/squid/SquidClamAV_Redirector.conf

##################
Traceback (most recent call last):
File "/usr/local/bin/SquidClamAV_Redirector.py", line 573, in ?
redirector = SquidClamAV_Redirector(config)
File "/usr/local/bin/SquidClamAV_Redirector.py", line 145, in
__init__
self.__start_urlhandler__()
File "/usr/local/bin/SquidClamAV_Redirector.py", line 454, in
__start_urlhandler__
urllib.socket.setdefaulttimeout(self.timeout)
AttributeError: 'module' object has no attribute 'setdefaulttimeout'
#################

the line that is the problem looks like this:

#############
urllib.socket.setdefaulttimeout(self.timeout)
#############

from the global sintax:

##############
def __start_urlhandler__(self):
""" create the urlhandler object """
# set timeout
urllib.socket.setdefaulttimeout(self.timeout)
self.urlhandler = urllib.URLopener()
if self.proxy != {}:
self.urlhandler.proxies = self.proxy
self.urlhandler.addheaders = [('User-agent',
ModuleName + ' ' + str(version))]

##############

can you give me a hint with this matter?

Jul 18 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
adrian wrote:
urllib.socket.setdefaulttimeout(self.timeout)
AttributeError: 'module' object has no attribute 'setdefaulttimeout'


socket.setdefaulttimeout() was added in Python 2.3. You need to upgrade.

Peter
Jul 18 '05 #2

P: n/a
That just means the urllib.socket module doesn't have any function
named setdefaulttimeout in it.

It appears there might be something wrong with your socket module as
mine has it:

py> import urllib
py> f = urllib.socket.setdefaulttimeout
py> f
<built-in function setdefaulttimeout>

Jul 18 '05 #3

P: n/a
Peter Otten wrote:
adrian wrote:

urllib.socket.setdefaulttimeout(self.timeout)
AttributeError: 'module' object has no attribute 'setdefaulttimeout'

socket.setdefaulttimeout() was added in Python 2.3. You need to upgrade.

Peter

Alternatively you might still be ablet o get Tom O'Malley's
tiemoutsocket module, which I used in several applications until 2.3
integrated the functionality.

regards
Steve
--
Steve Holden +1 703 861 4237 +1 800 494 3119
Holden Web LLC http://www.holdenweb.com/
Python Web Programming http://pydish.holdenweb.com/

Jul 18 '05 #4

P: n/a
Steve Holden <st***@holdenweb.com> writes:
Peter Otten wrote:
adrian wrote:
urllib.socket.setdefaulttimeout(self.timeout)
AttributeError: 'module' object has no attribute 'setdefaulttimeout'

socket.setdefaulttimeout() was added in Python 2.3. You need to
upgrade.
Peter

Alternatively you might still be ablet o get Tom O'Malley's
tiemoutsocket module, which I used in several applications until 2.3
integrated the functionality.


I seem to recall a bug related to sendall(), though, IIRC. I reported
it, but it didn't get fixed, again IIRC.
John
Jul 18 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.