473,397 Members | 2,056 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

Help Please: 'module' object has no attribute 'compile'

my log...

INFO urllib.urlopen('http://192.168.1.11/hact/kitchen.asp',
urllib.urlencode({'Action': 'hs.ExecX10ByName+Kitchen+Lights%2C+On
%2C+100&x=4&y=6'}))
INFO
INFO File "Q:\python\python23.zlib\urllib.py", line 78, in urlopen
INFO File "Q:\python\python23.zlib\urllib.py", line 159, in open
INFO File "Q:\python\python23.zlib\urllib.py", line 957, in splittype
INFO AttributeError
INFO :
INFO 'module' object has no attribute 'compile'
Jan 6 '06 #1
4 8420
livin wrote:
my log...

INFO urllib.urlopen('http://192.168.1.11/hact/kitchen.asp',
urllib.urlencode({'Action': 'hs.ExecX10ByName+Kitchen+Lights%2C+On
%2C+100&x=4&y=6'}))
INFO
INFO File "Q:\python\python23.zlib\urllib.py", line 78, in urlopen
INFO File "Q:\python\python23.zlib\urllib.py", line 159, in open
INFO File "Q:\python\python23.zlib\urllib.py", line 957, in splittype
INFO AttributeError
INFO :
INFO 'module' object has no attribute 'compile'


That line reads
_typeprog = re.compile('^([^/:]+):')

Do you have a module named 're' that is shadowing the library module of
the same name?

Kent
Jan 6 '06 #2
I beleive so... I cannot know for sure becasue the models are not
separate... they are in the python23.zlib file... I'm no sure how to check
the file, it looks as if it is compiled (I'm new to python so forgive my
ignorance)
"Kent Johnson" <ke**@kentsjohnson.com> wrote in message
news:43**********@newspeer2.tds.net...
livin wrote:
my log...

INFO urllib.urlopen('http://192.168.1.11/hact/kitchen.asp',
urllib.urlencode({'Action': 'hs.ExecX10ByName+Kitchen+Lights%2C+On
%2C+100&x=4&y=6'}))
INFO
INFO File "Q:\python\python23.zlib\urllib.py", line 78, in urlopen
INFO File "Q:\python\python23.zlib\urllib.py", line 159, in open
INFO File "Q:\python\python23.zlib\urllib.py", line 957, in splittype
INFO AttributeError
INFO :
INFO 'module' object has no attribute 'compile'


That line reads
_typeprog = re.compile('^([^/:]+):')

Do you have a module named 're' that is shadowing the library module of
the same name?

Kent

Jan 7 '06 #3
livin wrote:
I beleive so... I cannot know for sure becasue the models are not
separate... they are in the python23.zlib file... I'm no sure how to check
the file, it looks as if it is compiled (I'm new to python so forgive my
ignorance)
Yes, there should be an re module in your Python distribution, and it
should have a compile attribute. You can check this from the python
intepreter easily:
import re
re.compile

<function compile at 0x008FE0B0>

What I am suggesting is that YOU may have created a module named re that
Python is finding instead of the system module by that name. In this
case your module doesn't have a compile attribute. This would cause the
error you see.

Kent


"Kent Johnson" <ke**@kentsjohnson.com> wrote in message
news:43**********@newspeer2.tds.net...
livin wrote:
my log...

INFO urllib.urlopen('http://192.168.1.11/hact/kitchen.asp',
urllib.urlencode({'Action': 'hs.ExecX10ByName+Kitchen+Lights%2C+On
%2C+100&x=4&y=6'}))
INFO
INFO File "Q:\python\python23.zlib\urllib.py", line 78, in urlopen
INFO File "Q:\python\python23.zlib\urllib.py", line 159, in open
INFO File "Q:\python\python23.zlib\urllib.py", line 957, in splittype
INFO AttributeError
INFO :
INFO 'module' object has no attribute 'compile'


That line reads
_typeprog = re.compile('^([^/:]+):')

Do you have a module named 're' that is shadowing the library module of
the same name?

Kent


Jan 7 '06 #4
Oh, no I did not create any modules, wish I had the knowledge to do so!

I think I've moved beyond whatever that issue was and now getting a timeout.
The info is below... any help you can give is appreciate!
I'm running this code...

import os, re, string, urllib, types
data = urllib.urlencode({'control_device': 'Kitchen Lights=on'})
urllib.urlopen('http://192.168.1.11', data)
and get this error log from Python...

File "Q:\python\python23.zlib\urllib.py", line 78, in urlopen
File "Q:\python\python23.zlib\urllib.py", line 183, in open
File "Q:\python\python23.zlib\urllib.py", line 297, in open_http
File "Q:\python\python23.zlib\httplib.py", line 712, in endheaders
File "Q:\python\python23.zlib\httplib.py", line 597, in _send_output
File "Q:\python\python23.zlib\httplib.py", line 564, in send
File "Q:\python\python23.zlib\httplib.py", line 548, in connect
IOError
:
[Errno socket error] (10060, 'Operation timed out')
"Kent Johnson" <ke**@kentsjohnson.com> wrote in message
news:43**********@newspeer2.tds.net...
livin wrote:
I beleive so... I cannot know for sure becasue the models are not
separate... they are in the python23.zlib file... I'm no sure how to
check the file, it looks as if it is compiled (I'm new to python so
forgive my ignorance)


Yes, there should be an re module in your Python distribution, and it
should have a compile attribute. You can check this from the python
intepreter easily:
>>> import re
>>> re.compile

<function compile at 0x008FE0B0>

What I am suggesting is that YOU may have created a module named re that
Python is finding instead of the system module by that name. In this case
your module doesn't have a compile attribute. This would cause the error
you see.

Kent


"Kent Johnson" <ke**@kentsjohnson.com> wrote in message
news:43**********@newspeer2.tds.net...
livin wrote:

my log...

INFO urllib.urlopen('http://192.168.1.11/hact/kitchen.asp',
urllib.urlencode({'Action': 'hs.ExecX10ByName+Kitchen+Lights%2C+On
%2C+100&x=4&y=6'}))
INFO
INFO File "Q:\python\python23.zlib\urllib.py", line 78, in urlopen
INFO File "Q:\python\python23.zlib\urllib.py", line 159, in open
INFO File "Q:\python\python23.zlib\urllib.py", line 957, in splittype
INFO AttributeError
INFO :
INFO 'module' object has no attribute 'compile'

That line reads
_typeprog = re.compile('^([^/:]+):')

Do you have a module named 're' that is shadowing the library module of
the same name?

Kent



Jan 8 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Irmen de Jong | last post by:
What would be the best way, if any, to obtain the bytecode for a given loaded module? I can get the source: import inspect import os src = inspect.getsource(os) but there is no...
18
by: Steven Bethard | last post by:
In the "empty classes as c structs?" thread, we've been talking in some detail about my proposed "generic objects" PEP. Based on a number of suggestions, I'm thinking more and more that instead of...
3
by: gry | last post by:
I often find myself wanting an instance attribute that can take on only a few fixed symbolic values. (This is less functionality than an enum, since there are no *numbers* associated with the...
6
by: mike | last post by:
Hello, After trying to validate this page for a couple of days now I was wondering if someone might be able to help me out. Below is a list of snippets where I am having the errors. 1. Line 334,...
8
by: baustin75 | last post by:
Posted: Mon Oct 03, 2005 1:41 pm Post subject: cannot mail() in ie only when debugging in php designer 2005 -------------------------------------------------------------------------------- ...
3
by: Sky Sigal | last post by:
I coming unglued... really need some help. 3 days chasing my tail all over MSDN's documentation ...and I'm getting nowhere. I have a problem with TypeConverters and storage of expandableobjects...
1
by: Rahul | last post by:
Hi Everybody I have some problem in my script. please help me. This is script file. I have one *.inq file. I want run this script in XML files. But this script errors shows . If u want i am...
5
by: Gruik | last post by:
Hi people, I'm currently working on python embedding with C++. My goal is that the C++ part handle files writing/reading so that the Python part only works with buffers. I succeeded in buffer...
2
by: Gabriel Rossetti | last post by:
Hello everyone, I'm trying to use python's freeze utility but I'm running into problems. I called it like this : python /usr/share/doc/python2.5/examples/Tools/freeze/freeze.py...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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,...
0
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,...
0
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...
0
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...
0
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...
0
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,...

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.