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

livin livin at
Sun Jan 8 22:42:36 CET 2006

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('', data)

and get this error log from Python...

File "Q:\python\python23.zlib\", line 78, in urlopen
File "Q:\python\python23.zlib\", line 183, in open
File "Q:\python\python23.zlib\", line 297, in open_http
File "Q:\python\python23.zlib\", line 712, in endheaders
File "Q:\python\python23.zlib\", line 597, in _send_output
File "Q:\python\python23.zlib\", line 564, in send
File "Q:\python\python23.zlib\", line 548, in connect
[Errno socket error] (10060, 'Operation timed out')

"Kent Johnson" <kent at> wrote in message 
news:43c01ae6$1_3 at
> 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" <kent at> wrote in message 
>> news:43beeb5d$1_1 at
>>>livin wrote:
>>>>my log...
>>>>INFO urllib.urlopen('', 
>>>>urllib.urlencode({'Action': 'hs.ExecX10ByName+Kitchen+Lights%2C+On 
>>>> INFO   File "Q:\python\python23.zlib\", line 78, in urlopen
>>>>INFO   File "Q:\python\python23.zlib\", line 159, in open
>>>>INFO   File "Q:\python\python23.zlib\", 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?

More information about the Python-list mailing list