Skip to content

Commit 88e1234

Browse files
authored
Fix curl/wget cacert path (#1735)
Pass ordinary path names to curl/wget as those may not handle long UNC path names such as `\\?\C:...` well.
1 parent 0383979 commit 88e1234

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

package_control/downloaders/curl_downloader.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
from ..ca_certs import get_ca_bundle_path
66
from ..console_write import console_write
7+
from ..sys_path import shortpath
78
from .cli_downloader import CliDownloader
89
from .non_clean_exit_error import NonCleanExitError
910
from .downloader_exception import DownloaderException
@@ -100,7 +101,7 @@ def download(self, url, error_message, timeout, tries):
100101

101102
secure_url_match = re.match(r'^https://([^/#?]+)', url)
102103
if secure_url_match is not None:
103-
bundle_path = get_ca_bundle_path(self.settings)
104+
bundle_path = shortpath(get_ca_bundle_path(self.settings))
104105
command.extend(['--cacert', bundle_path])
105106

106107
debug = self.settings.get('debug')

package_control/downloaders/wget_downloader.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
from ..ca_certs import get_ca_bundle_path
77
from ..console_write import console_write
8+
from ..sys_path import shortpath
89
from .cli_downloader import CliDownloader
910
from .non_http_error import NonHttpError
1011
from .non_clean_exit_error import NonCleanExitError
@@ -104,7 +105,7 @@ def download(self, url, error_message, timeout, tries):
104105

105106
secure_url_match = re.match(r'^https://([^/#?]+)', url)
106107
if secure_url_match is not None:
107-
bundle_path = get_ca_bundle_path(self.settings)
108+
bundle_path = shortpath(get_ca_bundle_path(self.settings))
108109
command.append('--ca-certificate=' + bundle_path)
109110

110111
command.append('-S')

0 commit comments

Comments
 (0)