On Sun, Nov 10, 2002 at 12:55:36PM +0200, Kai Hendry wrote: > test.py is: > import re > p = re.compile('[a-z]+') > print p > > The first error message is from python2.1, python2.2 and last > python2.3 from SID. > > I think this is a serious packaging error, as it works on [GCC 2.96 > 20000731 (Red Hat Linux 7.2 2.96-109)] on linux2
It works for me, but see my comments below... > Regards, > -Kai Hendry > > > [EMAIL PROTECTED]:/tmp$ vim test.py I'm not sure how this command is related to the following tracebacks. > Traceback (most recent call last): > File "test.py", line 1, in ? > import re > ImportError: Bad magic number in re.pyc > > shell returned 1 Is there a file called "re.pyc" in the same directory as test.py? If so, was it possibly generated by a newer Python than the one that produced this traceback? > Hit ENTER or type command to continue > Traceback (most recent call last): > File "test.py", line 1, in ? > import re > File "/usr/lib/python2.2/re.py", line 3, in ? > # If your regexps don't work well under 2.0b1, you can switch > AttributeError: 'module' object has no attribute 'compile' > > shell returned 1 That traceback is screwy. The line that's reporting an error doesn't have any code on it. I suspect that is also caused by your mysterious re.pyc with the bad magic number. -Andrew.