Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix crash when file progress is empty #7114

Merged
merged 1 commit into from
Nov 2, 2022

Conversation

xoriole
Copy link
Contributor

@xoriole xoriole commented Oct 28, 2022

Fixes #7106

@xoriole xoriole marked this pull request as ready for review November 1, 2022 09:50
@xoriole xoriole requested review from a team and kozlovsky and removed request for a team November 1, 2022 09:50
@xoriole xoriole marked this pull request as draft November 1, 2022 09:50
@xoriole
Copy link
Contributor Author

xoriole commented Nov 1, 2022

Building on mac action failed with the following stacktrace:

33450 INFO: Loading module hook 'hook-faker.py' from '/Users/runner/work/tribler/tribler/build-env/lib/python3.8/site-packages/_pyinstaller_hooks_contrib/hooks/stdhooks'...
Traceback (most recent call last):
  File "<string>", line 2, in <module>
ModuleNotFoundError: No module named 'text_unidecode'
Traceback (most recent call last):
  File "/Users/runner/work/tribler/tribler/build-env/lib/python3.8/site-packages/PyInstaller/utils/hooks/__init__.py", line 357, in get_module_file_attribute
    attr = loader.get_filename(package)
AttributeError: 'NoneType' object has no attribute 'get_filename'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Users/runner/work/tribler/tribler/build-env/lib/python3.8/site-packages/PyInstaller/depend/imphook.py", line 408, in _load_hook_module
    self._hook_module = importlib_load_source(
  File "/Users/runner/work/tribler/tribler/build-env/lib/python3.8/site-packages/PyInstaller/compat.py", line 598, in importlib_load_source
    return mod_loader.load_module()
  File "<frozen importlib._bootstrap_external>", line 522, in _check_name_wrapper
  File "<frozen importlib._bootstrap_external>", line 1022, in load_module
  File "<frozen importlib._bootstrap_external>", line 847, in load_module
  File "<frozen importlib._bootstrap>", line 265, in _load_module_shim
  File "<frozen importlib._bootstrap>", line 702, in _load
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 843, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/Users/runner/work/tribler/tribler/build-env/lib/python3.8/site-packages/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-faker.py", line 17, in <module>
    collect_data_files('text_unidecode') +  # noqa: W504
  File "/Users/runner/work/tribler/tribler/build-env/lib/python3.8/site-packages/PyInstaller/utils/hooks/__init__.py", line 790, in collect_data_files
    pkg_base, pkg_dir = get_package_paths(package)
  File "/Users/runner/work/tribler/tribler/build-env/lib/python3.8/site-packages/PyInstaller/utils/hooks/__init__.py", line 573, in get_package_paths
    file_attr = get_module_file_attribute(package)
  File "/Users/runner/work/tribler/tribler/build-env/lib/python3.8/site-packages/PyInstaller/utils/hooks/__init__.py", line 375, in get_module_file_attribute
    raise ImportError('Unable to load module attribute') from e
ImportError: Unable to load module attribute

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/runner/work/tribler/tribler/build-env/bin/pyinstaller", line 33, in <module>
    sys.exit(load_entry_point('pyinstaller==4.2', 'console_scripts', 'pyinstaller')())
  File "/Users/runner/work/tribler/tribler/build-env/lib/python3.8/site-packages/PyInstaller/__main__.py", line 114, in run
    run_build(pyi_config, spec_file, **vars(args))
  File "/Users/runner/work/tribler/tribler/build-env/lib/python3.8/site-packages/PyInstaller/__main__.py", line 65, in run_build
    PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
  File "/Users/runner/work/tribler/tribler/build-env/lib/python3.8/site-packages/PyInstaller/building/build_main.py", line 725, in main
    build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build'))
  File "/Users/runner/work/tribler/tribler/build-env/lib/python3.8/site-packages/PyInstaller/building/build_main.py", line 672, in build
    exec(code, spec_namespace)
  File "tribler.spec", line 113, in <module>
    a = Analysis(['src/run_tribler.py'],
  File "/Users/runner/work/tribler/tribler/build-env/lib/python3.8/site-packages/PyInstaller/building/build_main.py", line 242, in __init__
    self.__postinit__()
  File "/Users/runner/work/tribler/tribler/build-env/lib/python3.8/site-packages/PyInstaller/building/datastruct.py", line 160, in __postinit__
    self.assemble()
  File "/Users/runner/work/tribler/tribler/build-env/lib/python3.8/site-packages/PyInstaller/building/build_main.py", line 420, in assemble
    self.graph.process_post_graph_hooks()
  File "/Users/runner/work/tribler/tribler/build-env/lib/python3.8/site-packages/PyInstaller/depend/analysis.py", line 367, in process_post_graph_hooks
    module_hook.post_graph()
  File "/Users/runner/work/tribler/tribler/build-env/lib/python3.8/site-packages/PyInstaller/depend/imphook.py", line [447](https://github.com/Tribler/tribler/actions/runs/3368427585/jobs/5588030622#step:6:448), in post_graph
    self._load_hook_module()
  File "/Users/runner/work/tribler/tribler/build-env/lib/python3.8/site-packages/PyInstaller/depend/imphook.py", line 412, in _load_hook_module
    raise ImportErrorWhenRunningHook(
PyInstaller.exceptions.ImportErrorWhenRunningHook: Failed to import module __PyInstaller_hooks_0_faker required by hook for module /Users/runner/work/tribler/tribler/build-env/lib/python3.8/site-packages/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-faker.py. Please check whether module __PyInstaller_hooks_0_faker actually exists and whether the hook is compatible with your version of /Users/runner/work/tribler/tribler/build-env/lib/python3.8/site-packages/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-faker.py: You might want to read more about hooks in the manual and provide a pull-request to improve PyInstaller.
Error: Process completed with exit code 1.

@xoriole xoriole marked this pull request as ready for review November 1, 2022 14:52
@xoriole xoriole merged commit 8fce053 into Tribler:main Nov 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

IndexError: list index out of range - get_files_completion
2 participants