473,836 Members | 1,519 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 7688
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
2479
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
9532
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
2055
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
3430
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
2048
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
2806
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
23453
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
6127
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
6392
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
9825
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
10854
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
10558
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10600
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10257
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...
0
9387
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7794
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...
1
4459
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
4022
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.