Patchwork [2,of,6,stable] py3: pass URL as str

login
register
mail settings
Submitter Manuel Jacob
Date June 30, 2020, 6:45 a.m.
Message ID <4d00ac33053273ed2b9a.1593499543@tmp>
Download mbox | patch
Permalink /patch/46594/
State Accepted
Headers show

Comments

Manuel Jacob - June 30, 2020, 6:45 a.m.
# HG changeset patch
# User Manuel Jacob <me@manueljacob.de>
# Date 1593486276 -7200
#      Tue Jun 30 05:04:36 2020 +0200
# Branch stable
# Node ID 4d00ac33053273ed2b9a6431800d59df94adcfc3
# Parent  2d738426309a0804a44c2024b97cef11aece6dde
# EXP-Topic svn_encoding
py3: pass URL as str

Before the patch, HTTP(S) URLs were never recognized as a Subversion repository
on Python 3.

Patch

diff --git a/hgext/convert/subversion.py b/hgext/convert/subversion.py
--- a/hgext/convert/subversion.py
+++ b/hgext/convert/subversion.py
@@ -284,7 +284,9 @@ 
 def httpcheck(ui, path, proto):
     try:
         opener = urlreq.buildopener()
-        rsp = opener.open(b'%s://%s/!svn/ver/0/.svn' % (proto, path), b'rb')
+        rsp = opener.open(
+            pycompat.strurl(b'%s://%s/!svn/ver/0/.svn' % (proto, path)), b'rb'
+        )
         data = rsp.read()
     except urlerr.httperror as inst:
         if inst.code != 404: