[Idle-dev] IDLE Replace broken for Python 2.0
David Scherer
dscherer@vysics.com
Thu, 8 Feb 2001 21:05:39 -0500
Thanks for the heads up.
A fix for this was indeed put in IDLE 0.6, but we never got it. Guido's CVS
log entry reads:
| python/dist/src/Tools/idle/ReplaceDialog.py
| Revision 1.4, Tue Sep 19 20:51:17 2000 UTC by gvanrossum
|
| Temporary fix for Bug #114821.
|
| The cause was that the replace code necessarily used a PCRE internal
| function to to template expansion.
|
| The fix changes the code to use an SRE internal if SRE is used, and a
| PCRE internal if SRE is used; in a way that should work with 1.5.2.
|
| The solution can be sped up tremendously under the assumption that the
| choice between sre and pre is not changed during the execution of the
| program; especially replace-all will be slow.
|
| But I'll leave that to someone else.
Merging this change with the idlefork is trivial: since idlefork never
changed this file, just copy the IDLE 0.6 ReplaceDialog.py over the idlefork
one.
Bruce, can you update the VPython download?
Dave
> -----Original Message-----
> From: idle-dev-admin@python.org [mailto:idle-dev-admin@python.org]On
> Behalf Of Cheney, Doug
> Sent: Thursday, February 08, 2001 2:53 PM
> To: 'idle-dev@python.org'
> Cc: 'dscherer@cmu.edu'
> Subject: RE: [Idle-dev] IDLE Replace broken for Python 2.0
>
>
>
> 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.
>
> _______________________________________________
> IDLE-dev mailing list
> IDLE-dev@python.org
> http://mail.python.org/mailman/listinfo/idle-dev
>