Patchwork [1,of,3,V2] py3: replace str() with bytes()

login
register
mail settings
Submitter Pulkit Goyal
Date April 7, 2017, 6:38 p.m.
Message ID <50b531cb22c78a068c5e.1491590303@pulkit-goyal>
Download mbox | patch
Permalink /patch/20006/
State Accepted
Headers show

Comments

Pulkit Goyal - April 7, 2017, 6:38 p.m.
# HG changeset patch
# User Pulkit Goyal <7895pulkit@gmail.com>
# Date 1491552995 -19800
#      Fri Apr 07 13:46:35 2017 +0530
# Node ID 50b531cb22c78a068c5effd84eb3c931187b5b71
# Parent  6b32872e4896993efe0abcc13b6d9c4c9b8687b7
py3: replace str() with bytes()

Patch

diff -r 6b32872e4896 -r 50b531cb22c7 mercurial/hg.py
--- a/mercurial/hg.py	Fri Apr 07 13:45:33 2017 +0530
+++ b/mercurial/hg.py	Fri Apr 07 13:46:35 2017 +0530
@@ -103,7 +103,7 @@ 
     if u.fragment:
         branch = u.fragment
         u.fragment = None
-    return str(u), (branch, branches or [])
+    return bytes(u), (branch, branches or [])
 
 schemes = {
     'bundle': bundlerepo,
diff -r 6b32872e4896 -r 50b531cb22c7 mercurial/util.py
--- a/mercurial/util.py	Fri Apr 07 13:45:33 2017 +0530
+++ b/mercurial/util.py	Fri Apr 07 13:46:35 2017 +0530
@@ -2799,7 +2799,7 @@ 
         user, passwd = self.user, self.passwd
         try:
             self.user, self.passwd = None, None
-            s = str(self)
+            s = bytes(self)
         finally:
             self.user, self.passwd = user, passwd
         if not self.user:
@@ -2854,7 +2854,7 @@ 
     u = url(u)
     if u.passwd:
         u.passwd = '***'
-    return str(u)
+    return bytes(u)
 
 def removeauth(u):
     '''remove all authentication information from a url string'''