Patchwork [11,of,11] py3: make regex bytes in hgweb/webcommands.py

login
register
mail settings
Submitter Pulkit Goyal
Date Feb. 23, 2018, 6:15 p.m.
Message ID <f22ce7b97364996db411.1519409724@workspace>
Download mbox | patch
Permalink /patch/28285/
State Accepted
Headers show

Comments

Pulkit Goyal - Feb. 23, 2018, 6:15 p.m.
# HG changeset patch
# User Pulkit Goyal <7895pulkit@gmail.com>
# Date 1519391846 -19800
#      Fri Feb 23 18:47:26 2018 +0530
# Node ID f22ce7b97364996db41168e4386329a4b223e0ed
# Parent  c8124f3591d41903f701df60f6786db8c77fb13d
py3: make regex bytes in hgweb/webcommands.py

# skip-blame because just b'' prefix

Patch

diff --git a/mercurial/hgweb/webcommands.py b/mercurial/hgweb/webcommands.py
--- a/mercurial/hgweb/webcommands.py
+++ b/mercurial/hgweb/webcommands.py
@@ -1116,7 +1116,7 @@  def archive(web, req, tmpl):
         msg = 'Archive type not allowed: %s' % type_
         raise ErrorResponse(HTTP_FORBIDDEN, msg)
 
-    reponame = re.sub(r"\W+", "-", os.path.basename(web.reponame))
+    reponame = re.sub(br"\W+", "-", os.path.basename(web.reponame))
     cnode = web.repo.lookup(key)
     arch_version = key
     if cnode == key or key == 'tip':