[PATCH STABLE] sslutil: fsencode path returned by certifi (issue6132)

Augie Fackler raf at durin42.com
Wed May 8 20:13:36 UTC 2019


# HG changeset patch
# User Augie Fackler <augie at google.com>
# Date 1557346190 14400
#      Wed May 08 16:09:50 2019 -0400
# Branch stable
# Node ID ce5f1232631ffd86d283e0087cf29b19a5bb039a
# Parent  e45c6b153e5157be5518f671b22f99fbab52e792
sslutil: fsencode path returned by certifi (issue6132)

By inspection, this is the only codepath that could be returning a
string instead of a bytes on Python 3.

diff --git a/mercurial/sslutil.py b/mercurial/sslutil.py
--- a/mercurial/sslutil.py
+++ b/mercurial/sslutil.py
@@ -722,7 +722,7 @@ def _defaultcacerts(ui):
         certs = certifi.where()
         if os.path.exists(certs):
             ui.debug('using ca certificates from certifi\n')
-            return certs
+            return pycompat.fsencode(certs)
     except (ImportError, AttributeError):
         pass
 


More information about the Mercurial-devel mailing list