Fix a string vs bytes issue in _guess_cgit_link
subprocess.check_output returns bytes, so we end up using '+' on a text
string (CGIT_BASE) and bytes (the output of parsed.path) in
_guess_cgit_link. Make sure we decode 'git_remote' in Python 3.
Change-Id: I9e846e2192ead41ca2328b8aa20994742096c51e
Closes-Bug: #1517525
Cyril Roelandt
8 years ago
12 | 12 | # under the License. |
13 | 13 | |
14 | 14 | import os |
15 | import six | |
15 | 16 | from six.moves.urllib import parse |
16 | 17 | import subprocess |
17 | 18 | |
27 | 28 | except subprocess.CalledProcessError: |
28 | 29 | return None |
29 | 30 | else: |
31 | if six.PY3: | |
32 | git_remote = os.fdecode(git_remote) | |
30 | 33 | parsed = parse.urlparse(git_remote) |
31 | 34 | return CGIT_BASE + parsed.path.lstrip('/') |
32 | 35 |