File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
qgis_deployment_toolbelt/jobs Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change 14
14
# Standard library
15
15
import logging
16
16
from pathlib import Path
17
- from shutil import unpack_archive
17
+ from shutil import ReadError , unpack_archive
18
18
19
19
# package
20
20
from qgis_deployment_toolbelt .jobs .generic_job import GenericJob
@@ -215,7 +215,18 @@ def install_plugin_into_profile(
215
215
# make sure destination folder exists
216
216
profile_plugins_folder .mkdir (parents = True , exist_ok = True )
217
217
218
- unpack_archive (filename = source_path , extract_dir = profile_plugins_folder )
218
+ # in some cases related to proxies issues, the plugin archive download
219
+ # returns a success but in fact it's just some HTML error from the proxy
220
+ # (but with wrong HTTP error code...) so the ZIP file is not really a zip...
221
+ try :
222
+ unpack_archive (filename = source_path , extract_dir = profile_plugins_folder )
223
+ except ReadError as err :
224
+ logger .error (
225
+ f"Plugin { plugin .name } ({ plugin .version } ) could not be unzipped nor "
226
+ f"installed in profile { profile .name } . Probably because of corrupted "
227
+ f"zip file. Is the plugin download worked before? Trace: { err } "
228
+ )
229
+ continue
219
230
220
231
logger .info (
221
232
f"Profile { profile .name } - "
You can’t perform that action at this time.
0 commit comments