474,003 Members | 66,386 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

AttributeError: 'module' object has no attribute 'setdefaulttime out'

I get those errors when I run:
/usr/local/bin/SquidClamAV_Red irector.py -c
/etc/squid/SquidClamAV_Red irector.conf

############### ###
Traceback (most recent call last):
File "/usr/local/bin/SquidClamAV_Red irector.py", line 573, in ?
redirector = SquidClamAV_Red irector(config)
File "/usr/local/bin/SquidClamAV_Red irector.py", line 145, in
__init__
self.__start_ur lhandler__()
File "/usr/local/bin/SquidClamAV_Red irector.py", line 454, in
__start_urlhand ler__
urllib.socket.s etdefaulttimeou t(self.timeout)
AttributeError: 'module' object has no attribute 'setdefaulttime out'
############### ##

the line that is the problem looks like this:

#############
urllib.socket.s etdefaulttimeou t(self.timeout)
#############

from the global sintax:

##############
def __start_urlhand ler__(self):
""" create the urlhandler object """
# set timeout
urllib.socket.s etdefaulttimeou t(self.timeout)
self.urlhandler = urllib.URLopene r()
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
4 7713
adrian wrote:
urllib.socket.s etdefaulttimeou t(self.timeout)
AttributeError: 'module' object has no attribute 'setdefaulttime out'


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

Peter
Jul 18 '05 #2
That just means the urllib.socket module doesn't have any function
named setdefaulttimeo ut in it.

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

py> import urllib
py> f = urllib.socket.s etdefaulttimeou t
py> f
<built-in function setdefaulttimeo ut>

Jul 18 '05 #3
Peter Otten wrote:
adrian wrote:

urllib.socket .setdefaulttime out(self.timeou t)
AttributeErro r: 'module' object has no attribute 'setdefaulttime out'

socket.setdefau lttimeout() 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
Steve Holden <st***@holdenwe b.com> writes:
Peter Otten wrote:
adrian wrote:
urllib.socket .setdefaulttime out(self.timeou t)
AttributeErro r: 'module' object has no attribute 'setdefaulttime out'

socket.setdefau lttimeout() 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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2491
by: seth | last post by:
Last week I encountered an AttributeError in my unit tests that I wasn'table to catch with an "except AttributeError" statement. The problem stemmed from a class that raised an error inside __init__and defined a __del__ method to clean up resources. I then discovered asimilar problem in the shelve module. This led me to two importantdiscoveries: 1. Attributes defined in __init__ after an error is raised will not be apart of the...
2
9549
by: dont bother | last post by:
Hey, I am trying to run the following example from diveintopython import urllib sock = urllib.urlopen("http://diveintopython.org/") htmlSource = sock.read() sock.close() print htmlSource
0
2065
by: Erlend Fuglum | last post by:
I have tried and tried, but cannot figure out the source of the following error: AttributeError: 'module' object has no attribute 'menyHMTL' __doc__ = 'Attribute not found.' __getitem__ = <bound method AttributeError.__getitem__ of <exceptions.AttributeError instance at 0x8187984>> __init__ = <bound method AttributeError.__init__ of <exceptions.AttributeError instance at 0x8187984>> __module__ = 'exceptions'
2
3441
by: rsd | last post by:
Hi, I'm trying get Samsung YH-920 mp3 player to work with Debian GNU/Linux. To do that I need to run http://www.paul.sladen.org/toys/samsung-yh-925/yh-925-db-0.1.py script, the idea behind the script is described at http://www.paul.sladen.org/toys/samsung-yh-925/ I'm getting errors and hoping someone could give me some hints, for I have no python background.
2
2056
by: Thomas Guettler | last post by:
Hi, how can you list the attributes of an object if you catch an AttributeError? I couldn't find a reference in the exception object, which points to the object. I want to call dir() on the object to list the user the known attributes.
3
2819
by: Juha S. | last post by:
I'm getting a "AttributeError: 'module' object has no attribute 'clock'" when importing a module from within two packages related to the line: "self.lastTime = time.clock()" in the __init__() of the class Time in the target module. The module (mytime.py) sits in a package hierarchy such as the following "packageA.packageB.mytime", and imports the Python module "time" like this: "import time" In another module outside of both packages...
4
23491
by: black_13 | last post by:
what does this error mean? i am trying to use mark hammonds win32 package. Traceback (most recent call last): File "aui2.py", line 11, in <module> import win32com.client File "C:\Python25\lib\site-packages\win32com\client\__init__.py", line 12, in <module> import dynamic, gencache, pythoncom File "C:\Python25\Lib\site-packages\win32com\client\dynamic.py",
4
6147
by: Nikhil | last post by:
I have recently written a small module. When I import the module, I always get the error only when I do -- Traceback (most recent call last): File "<stdin>", line 1, in <module>
1
6409
by: =?iso-8859-1?q?KLEIN_St=E9phane?= | last post by:
Hi, I'm on Ubuntu 8.04.1 I've installed lxml with easy_install lxml command. Now, when I load etree I've this error : $ python Python 2.5.2 (r252:60911, Apr 21 2008, 11:12:42)
0
10440
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10254
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11975
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
11020
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
8581
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7729
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
5283
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4850
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3877
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.