Bug 260729
| Summary: | SyntaxWarning when running 'git-webkit pr' | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Michael Catanzaro <mcatanzaro> |
| Component: | Tools / Tests | Assignee: | Michael Catanzaro <mcatanzaro> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | mcatanzaro, webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
Michael Catanzaro
I see some errors when running 'git-webkit pr':
Downloading cryptography-36.0.2...
Installed cryptography-36.0.2!
Switched to a new branch 'eng/python-autoinstaller-is-broken-with-python-3-12'
Created the local development branch 'eng/python-autoinstaller-is-broken-with-python-3-12'
/home/mcatanzaro/Projects/WebKit/Tools/Scripts/webkitpy/common/checkout/checkout.py:52: SyntaxWarning: invalid escape sequence '\['
COMMIT_SUBJECT_RE = re.compile(b'Subject: \[PATCH ?(\d+\/\d+)?] (.+)')
/home/mcatanzaro/Projects/WebKit/Tools/Scripts/webkitpy/common/checkout/checkout.py:53: SyntaxWarning: invalid escape sequence '\('
FILTER_BRANCH_PROGRAM = '''import re
error: invalid key: branch.eng/python-autoinstaller-is-broken-with-python-3-12.cherry_picked
Running status to find changed, added, or removed files.
Reviewing diff to determine which lines changed.
The SyntaxWarning is new in python 3.12.
I will report a separate issue for the "error: invalid key" problem.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Michael Catanzaro
(In reply to Michael Catanzaro from comment #0)
> I will report a separate issue for the "error: invalid key" problem.
Bug #260730
Michael Catanzaro
Here is a fix:
diff --git a/Tools/Scripts/webkitpy/common/checkout/checkout.py b/Tools/Scripts/webkitpy/common/checkout/checkout.py
index aefa8c7b4d05..e2f72653e70c 100644
--- a/Tools/Scripts/webkitpy/common/checkout/checkout.py
+++ b/Tools/Scripts/webkitpy/common/checkout/checkout.py
@@ -49,8 +49,8 @@ if sys.version_info > (3, 0):
# FIXME: Move a bunch of ChangeLog-specific processing from SCM to this object.
# NOTE: All paths returned from this class should be absolute.
class Checkout(object):
- COMMIT_SUBJECT_RE = re.compile(b'Subject: \[PATCH ?(\d+\/\d+)?] (.+)')
- FILTER_BRANCH_PROGRAM = '''import re
+ COMMIT_SUBJECT_RE = re.compile(r'Subject: \[PATCH ?(\d+\/\d+)?] (.+)')
+ FILTER_BRANCH_PROGRAM = r'''import re
import sys
lines = [l for l in sys.stdin]
I will create a pull request for this after bug #260726 is fixed.
Michael Catanzaro
Oh, and the problem was the backslash \ is a python string escape rather than a regex escape. Each \ would need to be \\ to be a regex escape. The leading r switches to "raw string notation" to avoid this problem. https://docs.python.org/3.12/library/re.html
Michael Catanzaro
Pull request: https://github.com/WebKit/WebKit/pull/17196
EWS
Committed 267558@main (ade70bdb664e): <https://commits.webkit.org/267558@main>
Reviewed commits have been landed. Closing PR #17196 and removing active labels.
Radar WebKit Bug Importer
<rdar://problem/114828777>