Fix SF # 591713, Fix "file:" URL to have right no. of /'s, by Bruce Atherton

Add a test too.  urljoin() would make file:/tmp/foo instead of file:///tmp/foo

Bugfix candidate, I will backport.
diff --git a/Lib/test/test_urlparse.py b/Lib/test/test_urlparse.py
index d3efa9e..b821879 100644
--- a/Lib/test/test_urlparse.py
+++ b/Lib/test/test_urlparse.py
@@ -17,9 +17,14 @@
                                ('http', 'www.python.org', '/', '', '', 'abc')),
                               (RFC1808_BASE,
                                ('http', 'a', '/b/c/d', 'p', 'q', 'f')),
+                              ('file:///tmp/junk.txt',
+                               ('file', '', '/tmp/junk.txt', '', '', '')),
                               ]:
             result = urlparse.urlparse(url)
             self.assertEqual(result, expected)
+            # put it back together and it should be the same
+            result2 = urlparse.urlunparse(result)
+            self.assertEqual(result2, url)
 
     def checkJoin(self, base, relurl, expected):
         self.assertEqual(urlparse.urljoin(base, relurl), expected)
diff --git a/Lib/urlparse.py b/Lib/urlparse.py
index ee99645..6361937 100644
--- a/Lib/urlparse.py
+++ b/Lib/urlparse.py
@@ -128,7 +128,7 @@
     return urlunsplit((scheme, netloc, url, query, fragment))
 
 def urlunsplit((scheme, netloc, url, query, fragment)):
-    if netloc or (scheme in uses_netloc and url[:2] == '//'):
+    if netloc or (scheme in uses_netloc and url[:2] != '//'):
         if url and url[:1] != '/': url = '/' + url
         url = '//' + (netloc or '') + url
     if scheme: