Patchwork D6863: py3: byte-prefix sanitisation regexes in phabricator.py

login
register
mail settings
Submitter phabricator
Date Sept. 17, 2019, 8:11 p.m.
Message ID <differential-rev-PHID-DREV-sbl3r3z23k5ve4lejm3x-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/41703/
State Superseded
Headers show

Comments

phabricator - Sept. 17, 2019, 8:11 p.m.
Kwan created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  So it doesn't die with "TypeError: cannot use a string pattern on a bytes-like
  object".

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  hgext/phabricator.py

CHANGE DETAILS




To: Kwan, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/hgext/phabricator.py b/hgext/phabricator.py
--- a/hgext/phabricator.py
+++ b/hgext/phabricator.py
@@ -136,8 +136,8 @@ 
 
     def sanitiserequest(request):
         request.body = re.sub(
-            r'cli-[a-z0-9]+',
-            r'cli-hahayouwish',
+            br'cli-[a-z0-9]+',
+            br'cli-hahayouwish',
             request.body
         )
         return request