From 2545e433bf7e3271bb1c9bcd5d6978c17d0f28ba Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Wed, 21 Dec 2011 09:17:25 +0000 Subject: [PATCH] Add workaround for broken urlparse. Fixes bug 905010. urlparse on Python 2.6.1 on OSX can't parse the ssh urls properly. So we special case commando it if the parse failure follows the way that the broken urlparse will mis-parse the string. Change-Id: I1a550fce77e596d2529436e4024792e9c86d2e4e --- git-review | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/git-review b/git-review index 6f8df18..0694bcc 100755 --- a/git-review +++ b/git-review @@ -207,6 +207,11 @@ def split_hostname(fetch_url): hostname = parsed_url.netloc port = 22 + # Workaround bug in urlparse on OSX + if parsed_url.scheme == "ssh" and hostname[:2] == "//": + hostname = hostname[2:] + hostname = hostname.split("/")[0] + if "@" in hostname: (username, hostname) = hostname.split("@") if ":" in hostname: