This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ezio.melotti
Recipients ezio.melotti, roger.serwy, terry.reedy
Date 2011-10-14.22:19:56
SpamBayes Score 7.09979e-07
Marked as misclassified No
Message-id <>
Defining the desired behavior is a good place where to start.  Next it would be good to have tests that reflect the desired behavior, and eventually make them pass with a proper patch.

Currently IDLE seems to understand \n, \t, etc. in the "Replace with" field, but not in the "Find" field.  That means that it's possible to easily replace e.g. 4 spaces with a \t, but not the other way around.
This works regardless of the "Regular expression" checkbox.

When "Regular expression" is checked, backreferences like \1 also work (if used correctly).

I think these behaviors are fine and should be preserved.  For the non-regex mode, re.escape() could be used if the \n, \t, etc. still work, but I think that for the regex mode the right way to go is to catch regex errors.  This will protect against wrong backreferences and trailing \, without altering the meaning of the regex.

We could also support \n, \t, etc. in the "Find" box, but that's a separate issue.

Regarding the print(input()) and the other example, they all seem to work fine here with 3.2/XP.
Date User Action Args
2011-10-14 22:19:57ezio.melottisetrecipients: + ezio.melotti, terry.reedy, roger.serwy
2011-10-14 22:19:57ezio.melottisetmessageid: <>
2011-10-14 22:19:56ezio.melottilinkissue13052 messages
2011-10-14 22:19:56ezio.melotticreate