473,687 Members | 3,230 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 7669
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
2462
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
9523
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
2045
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
3419
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
2040
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
2794
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
23436
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
6118
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
6380
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
8528
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
8947
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
8782
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
8786
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
7621
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
6453
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
5807
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();...
0
4321
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
3
1950
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.