miurahr / aqtinstall

aqt: Another (unofficial) Qt CLI Installer on multi-platforms
https://aqtinstall.readthedocs.io/en/latest/
MIT License
914 stars 84 forks source link

Bad7zFile when targeting relative parent folder (..) #701

Closed kiwixz closed 1 year ago

kiwixz commented 1 year ago

Describe the bug Trying to install Qt to a relative parent folder (with ..\) raises py7zr.exceptions.Bad7zFile: Specified path is bad.

To Reproduce Add ..\ to the path of -O option.

Expected behavior No errors.

aqt output

C:\Users\u\Desktop>aqt install-qt -O qt windows desktop 5.15.2 win64_msvc2019_64 --archives qtbase
INFO    : aqtinstall(aqt) v3.1.7 on Python 3.11.4 [CPython MSC v.1934 64 bit (AMD64)]
INFO    : Downloading qtbase...
INFO    : Redirected: mirrors.20i.com
INFO    : Finished installation of qtbase-Windows-Windows_10-MSVC2019-Windows-Windows_10-X86_64.7z in 11.14591060
INFO    : Patching qt\5.15.2\msvc2019_64\bin\qmake.exe
INFO    : Finished installation
INFO    : Time elapsed: 12.73906280 second
C:\Users\u\Desktop\somewhere>aqt install-qt -O ..\qt windows desktop 5.15.2 win64_msvc2019_64 --archives qtbase
INFO    : aqtinstall(aqt) v3.1.7 on Python 3.11.4 [CPython MSC v.1934 64 bit (AMD64)]
INFO    : Downloading qtbase...
INFO    : Redirected: mirrors.20i.com
WARNING : Caught Bad7zFile, terminating installer workers
ERROR   : Specified path is bad: 5.15.2
Traceback (most recent call last):
  File "C:\Users\u\AppData\Local\Programs\Python\Python311\Lib\site-packages\aqt\installer.py", line 182, in run
    args.func(args)
  File "C:\Users\u\AppData\Local\Programs\Python\Python311\Lib\site-packages\aqt\installer.py", line 436, in run_install_qt
    run_installer(qt_archives.get_packages(), base_dir, sevenzip, keep, _archive_dest)
  File "C:\Users\u\AppData\Local\Programs\Python\Python311\Lib\site-packages\aqt\installer.py", line 1173, in run_installer
    raise e from e
  File "C:\Users\u\AppData\Local\Programs\Python\Python311\Lib\site-packages\aqt\installer.py", line 1132, in run_installer
    pool.starmap(installer, tasks)
  File "C:\Users\u\AppData\Local\Programs\Python\Python311\Lib\multiprocessing\pool.py", line 375, in starmap
    return self._map_async(func, iterable, starmapstar, chunksize).get()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\u\AppData\Local\Programs\Python\Python311\Lib\multiprocessing\pool.py", line 774, in get
    raise self._value
py7zr.exceptions.Bad7zFile: Specified path is bad: 5.15.2
ERROR   : aqtinstall(aqt) v3.1.7 on Python 3.11.4 [CPython MSC v.1934 64 bit (AMD64)]
Working dir: `C:\Users\u\Desktop\somewhere`
Arguments: `['C:\\Users\\u\\AppData\\Local\\Programs\\Python\\Python311\\Scripts\\aqt', 'install-qt', '-O', '..\\qt', 'windows', 'desktop', '5.15.2', 'win64_msvc2019_64', '--archives', 'qtbase']` Host: `uname_result(system='Windows', node='win11', release='10', version='10.0.22621', machine='AMD64')`
===========================PLEASE FILE A BUG REPORT===========================
You have discovered a bug in aqt.
Please file a bug report at https://github.com/miurahr/aqtinstall/issues
Please remember to include a copy of this program's output in your report.

Desktop (please complete the following information):

miurahr commented 1 year ago

This seems a bug in a dependency library py7zr

py7zr.exceptions.Bad7zFile: Specified path is bad: 5.15.2

Exception is raised when extract folder 5.15.2 into target folder ../ in py7zr

miurahr commented 1 year ago

@kiwixz could you try with py7zr@0.20.6 ?

kiwixz commented 1 year ago

It fixes it, good job!