Help Please: 'module' object has no attribute 'compile'
livin
livin at
Sun Jan 8 16:42:36 EST 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('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" <kent at kentsjohnson.com> wrote in message
news:43c01ae6$1_3 at 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" <kent at kentsjohnson.com> wrote in message
>> news:43beeb5d$1_1 at 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
>>
>>
More information about the Python-list
mailing list