[Bug 5711] New: Cannot clone in Python 3 due to string handling

mercurial-bugs at mercurial-scm.org mercurial-bugs at mercurial-scm.org
Mon Oct 16 19:12:19 UTC 2017


https://bz.mercurial-scm.org/show_bug.cgi?id=5711

            Bug ID: 5711
           Summary: Cannot clone in Python 3 due to string handling
           Product: Mercurial
           Version: 4.3.3
          Hardware: Macintosh
                OS: Mac OS
            Status: UNCONFIRMED
          Severity: bug
          Priority: wish
         Component: Mercurial
          Assignee: bugzilla at mercurial-scm.org
          Reporter: rick1 at gerkin.org
                CC: mercurial-devel at mercurial-scm.org

# Python 2 version, succeeds
~/miniconda2/bin/hg clone https://www.neuron.yale.edu/hg/neuron/nrn

# Python 3 version, fails
~/miniconda2/bin/hg clone https://www.neuron.yale.edu/hg/neuron/nrn

The error message is: 
abort: error: unknown url type: b'https

This results from the clone argument being processed as a bytes object in
Python 3, which urllib.request cannot handle.  

Example in Python 3:  
from urllib.request import urlopen,Request
url1 = "http://www.python.org"
url2 = b"http://www.python.org"
r1 = Request(url1)
r2 = Request(url2)
urlopen(r1) # Works
urlopen(r2) # Fails
# Easily fixed with:  
r2_fixed = Request(url2.decode())
urlopen(r2_fixed)

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Mercurial-devel mailing list