My python interpreter became mad !

Tim Golden mail at timgolden.me.uk
Tue Mar 25 07:13:15 EDT 2008


Benjamin Watine wrote:
> Yes, my python interpreter seems to became mad ; or may be it's me ! :)
> 
> I'm trying to use re module to match text with regular expression. In a 
> first time, all works right. But since yesterday, I have a very strange 
> behaviour :
> 
> $ python2.4
> Python 2.4.4 (#2, Apr  5 2007, 20:11:18)
> [GCC 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
>  >>> import re
> X-Spam-Flag: YES
> X-Spam-Checker-Version: SpamAssassin 3.1.7-deb (2006-10-05) on w3hosting.org
> X-Spam-Level: **********************
> X-Spam-Status: Yes, score=22.2 required=5.0 tests=MISSING_HB_SEP,
>          MISSING_HEADERS,MISSING_SUBJECT,RAZOR2_CF_RANGE_51_100,
>  
> RAZOR2_CF_RANGE_E8_51_100,RAZOR2_CHECK,TO_CC_NONE,UNPARSEABLE_RELAY,
>  
> URIBL_AB_SURBL,URIBL_JP_SURBL,URIBL_OB_SURBL,URIBL_SBL,URIBL_SC_SURBL,
>          URIBL_WS_SURBL autolearn=failed version=3.1.7-deb
> 
> Traceback (most recent call last):
>    File "<stdin>", line 1, in ?
>    File "/etc/postfix/re.py", line 19, in ?
>      m = re.match('(Spam)', mail)
> AttributeError: 'module' object has no attribute 'match'
>  >>>

Extremely likely that, in the course of testing some
re technique, you've created a module in this directory
called "re.py". When you import re, you're actually
importing your own module.

TJG



More information about the Python-list mailing list