Patchwork D10064: re2: byteify some regex used to get check re2 availability

login
register
mail settings
Submitter phabricator
Date Feb. 24, 2021, 2:32 p.m.
Message ID <differential-rev-PHID-DREV-ke3kzm4lxcxsm27oxoh2-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/48379/
State Superseded
Headers show

Comments

phabricator - Feb. 24, 2021, 2:32 p.m.
marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  Changeset 687b865b95ad <https://phab.mercurial-scm.org/rHG687b865b95add1fb486e556ab3afc9321f3f298c> failed to properly byteify this because it was a raw
  string. This went undetected so far because re2 does not seems to be widely
  tested.

REPOSITORY
  rHG Mercurial

BRANCH
  stable

REVISION DETAIL
  https://phab.mercurial-scm.org/D10064

AFFECTED FILES
  mercurial/util.py

CHANGE DETAILS




To: marmoute, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/mercurial/util.py b/mercurial/util.py
--- a/mercurial/util.py
+++ b/mercurial/util.py
@@ -2170,7 +2170,7 @@ 
         global _re2
         try:
             # check if match works, see issue3964
-            _re2 = bool(re2.match(r'\[([^\[]+)\]', b'[ui]'))
+            _re2 = bool(re2.match(br'\[([^\[]+)\]', b'[ui]'))
         except ImportError:
             _re2 = False