Skip to content

bpo-38294: Add list of no-longer-escaped chars to re.escape documentation #16442

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Oct 7, 2019
Merged

Conversation

rbanffy
Copy link
Contributor

@rbanffy rbanffy commented Sep 27, 2019

The changes in behavior from 3.6 to 3.7 caused some minor issues with code that still needs to run on 2.7 while it is being migrated to 3.7.

Since "/" is usually a common delimiter for regexes, we assumed it'd be escaped, as it was up to 3.6, but since that's no longer the case, it'd be nice to emphasise the difference a little bit more than the current documentation does. As it is, it's easy to miss this specific character.

https://bugs.python.org/issue38294

@the-knights-who-say-ni
Copy link

Hello, and thanks for your contribution!

I'm a bot set up to make sure that the project can legally accept this contribution by verifying everyone involved has signed the PSF contributor agreement (CLA).

Recognized GitHub username

We couldn't find a bugs.python.org (b.p.o) account corresponding to the following GitHub usernames:

@rbanffy

This might be simply due to a missing "GitHub Name" entry in one's b.p.o account settings. This is necessary for legal reasons before we can look at this contribution. Please follow the steps outlined in the CPython devguide to rectify this issue.

You can check yourself to see if the CLA has been received.

Thanks again for the contribution, we look forward to reviewing it!

@bedevere-bot bedevere-bot added docs Documentation in the Doc dir awaiting review labels Sep 27, 2019
Ricardo Bánffy and others added 3 commits September 28, 2019 00:33
Prior to 3.7, re.escape escaped many characters that don't have
special meaning in Python, but that use to require escaping in other
tools and languages. This commit aims to make it clear which characters
were, but are no longer escaped.
… isn't - escaped

The current example shows escaping only of infix math operators. This example uses
string.punctuation as input and doesn't change the order of the characters for the
output.
This example illustrates two characters that changed behavior recently in
addition to ".", which continues to be escaped.
@miss-islington
Copy link
Contributor

Thanks @rbanffy for the PR, and @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.7, 3.8.
🐍🍒⛏🤖

@miss-islington
Copy link
Contributor

I'm having trouble backporting to 3.8. Reason: 'Error 110 while writing to socket. Connection timed out.'. Please retry by removing and re-adding the needs backport to 3.8 label.

@miss-islington
Copy link
Contributor

Sorry, @rbanffy and @serhiy-storchaka, I could not cleanly backport this to 3.7 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker 15ae75d660befe643ed42eb2707a557cea97256c 3.7

@miss-islington
Copy link
Contributor

Thanks @rbanffy for the PR, and @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.8.
🐍🍒⛏🤖

@miss-islington
Copy link
Contributor

Sorry @rbanffy and @serhiy-storchaka, I had trouble checking out the 3.8 backport branch.
Please backport using cherry_picker on command line.
cherry_picker 15ae75d660befe643ed42eb2707a557cea97256c 3.8

serhiy-storchaka pushed a commit to serhiy-storchaka/cpython that referenced this pull request Oct 7, 2019
…umentation. (pythonGH-16442)

Prior to 3.7, re.escape escaped many characters that don't have
special meaning in Python, but that use to require escaping in other
tools and languages. This commit aims to make it clear which characters
were, but are no longer escaped.
(cherry picked from commit 15ae75d)

Co-authored-by: Ricardo Bánffy <rbanffy@gmail.com>
@miss-islington
Copy link
Contributor

Thanks @rbanffy for the PR, and @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.8.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Oct 7, 2019
…tion. (pythonGH-16442)

Prior to 3.7, re.escape escaped many characters that don't have
special meaning in Python, but that use to require escaping in other
tools and languages. This commit aims to make it clear which characters
were, but are no longer escaped.
(cherry picked from commit 15ae75d)

Co-authored-by: Ricardo Bánffy <rbanffy@gmail.com>
@bedevere-bot
Copy link

GH-16626 is a backport of this pull request to the 3.8 branch.

@miss-islington
Copy link
Contributor

Thanks @rbanffy for the PR, and @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.7.
🐍🍒⛏🤖

@miss-islington
Copy link
Contributor

Sorry, @rbanffy and @serhiy-storchaka, I could not cleanly backport this to 3.7 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker 15ae75d660befe643ed42eb2707a557cea97256c 3.7

miss-islington added a commit that referenced this pull request Oct 7, 2019
…tion. (GH-16442)

Prior to 3.7, re.escape escaped many characters that don't have
special meaning in Python, but that use to require escaping in other
tools and languages. This commit aims to make it clear which characters
were, but are no longer escaped.
(cherry picked from commit 15ae75d)

Co-authored-by: Ricardo Bánffy <rbanffy@gmail.com>
@bedevere-bot
Copy link

GH-16647 is a backport of this pull request to the 3.7 branch.

serhiy-storchaka pushed a commit that referenced this pull request Oct 8, 2019
…umentation. (GH-16442) (GH-16647)

Prior to 3.7, re.escape escaped many characters that don't have
special meaning in Python, but that use to require escaping in other
tools and languages. This commit aims to make it clear which characters
were, but are no longer escaped.
(cherry picked from commit 15ae75d)
ned-deily pushed a commit to ned-deily/cpython that referenced this pull request Oct 14, 2019
…umentation. (pythonGH-16442) (pythonGH-16647)

Prior to 3.7, re.escape escaped many characters that don't have
special meaning in Python, but that use to require escaping in other
tools and languages. This commit aims to make it clear which characters
were, but are no longer escaped.
(cherry picked from commit 15ae75d)
jacobneiltaylor pushed a commit to jacobneiltaylor/cpython that referenced this pull request Dec 5, 2019
…tion. (pythonGH-16442)

Prior to 3.7, re.escape escaped many characters that don't have
special meaning in Python, but that use to require escaping in other
tools and languages. This commit aims to make it clear which characters
were, but are no longer escaped.
@serhiy-storchaka serhiy-storchaka removed their assignment Dec 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants