[Idle-dev] IDLE Replace broken for Python 2.0

Cheney, Doug dcc@iti-oh.com
Thu, 8 Feb 2001 14:53:24 -0500


Sorry for the false alarm--I was using the customized version of IDLE 0.5 distributed by David Scherer at CMU in their VPython customization of Python 2.0.

I downloaded the official version of Python 2.0 and the Replace function works fine.

-Doug

-----Original Message-----
From: Mats Wichmann [mailto:mats@laplaza.org]
Sent: Thursday, February 08, 2001 10:52 AM
To: Cheney, Doug; 'idle-dev@python.org'
Subject: Re: [Idle-dev] IDLE Replace broken for Python 2.0


At 10:36 AM 02/08/2001 -0500, Cheney, Doug wrote:
 >
 >I have searched the idle-dev archives and did not find this problem
 >identified.  I apologize if I missed it.
 >
 >I have been using IDLE for production Python programming the past two years
 >using CADScript--ITI's consistent Python API for all major CAD systems
 >(www.iti-oh.com/pdi).
 >
 >The Replace capability is one I rely on regularly.  It worked fine for IDLE
 >0.5 and Python 1.5.2.
 >
 >When I use Replace in IDLE 0.6 and Python 2.0 I get the following error
 >(WIN32):
 >
 >>>> Exception in Tkinter callback
 >Traceback (most recent call last):
 >  File "c:\python20\lib\lib-tk\Tkinter.py", line 1287, in __call__
 >    return apply(self.func, args)
 >  File "C:\sandbox\idle-0.5\ReplaceDialog.py", line 62, in default_command
 >    self.do_replace()
 >  File "C:\sandbox\idle-0.5\ReplaceDialog.py", line 145, in do_replace
 >    new = re.pcre_expand(m, self.replvar.get())
 >AttributeError: pcre_expand
 >
 >Please help me resolve this regression.


Doug, treat this as comments from someone who doesn't know much
about IDLE.

Python 2.0 uses a new regular expression engine, "re" is a wrapper
to get to the right one, "sre" is the current engine, the older
one was "pre".  As far as I can tell, only "pre" imports from "pcre"...
I think that's the source of the message, anyway.  I don't even
have a pcre any more.

Looks from your traceback like you're actually using IDLE 0.5
instead of 0.6.  Maybe you did try 0.6, but if not, you might
want to switch over.