MCPcopy Create free account
hub / github.com/conda/constructor / _check_installer_log

Function _check_installer_log

tests/test_examples.py:149–173  ·  view source on GitHub ↗
(install_dir)

Source from the content-addressed store, hash-verified

147
148
149def _check_installer_log(install_dir):
150 # Windows installers won't raise exit codes so we need to check the log file
151 error_lines = []
152 try:
153 log_is_empty = True
154 with open(os.path.join(install_dir, "install.log"), encoding="utf-16-le") as f:
155 print("Installer log:", file=sys.stderr)
156 for line in f:
157 log_is_empty = False
158 print(line, end="", file=sys.stderr)
159 if ":error:" in line.lower():
160 error_lines.append(line)
161 if log_is_empty:
162 error_lines.append("Logfile was unexpectedly empty!")
163 except Exception as exc:
164 error_lines.append(
165 f"Could not read logs! {exc.__class__.__name__}: {exc}\n"
166 "Did you install the 'log' variant of nsis? 'conda install conda-forge::nsis=*=*log*'\n"
167 "Once you have installed it, set NSIS_USING_LOG_BUILD=1.\n"
168 "Otherwise, this usually means that the destination folder could not be created.\n"
169 "Possible causes: permissions, non-supported characters, long paths...\n"
170 "Consider setting 'check_path_spaces' to 'False'."
171 )
172 if error_lines:
173 raise AssertionError("\n".join(error_lines))
174
175
176def _run_installer_exe(

Callers 3

_run_installer_exeFunction · 0.85
_run_uninstaller_exeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected