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

[Bug]: Failure when installing example on Windows #867

Open
1 task done
vserdyuk opened this issue Dec 23, 2024 · 2 comments
Open
1 task done

[Bug]: Failure when installing example on Windows #867

vserdyuk opened this issue Dec 23, 2024 · 2 comments
Labels
bug Something isn't working triage

Comments

@vserdyuk
Copy link

Bug description

Command

aqt install-example --outputdir D:\Qt2 windows 6.8.0

fails to complete on Windows 11 with aqt v3.1.21. Was working fine with v3.1.19.

I had some modifications in settings.ini:

[DEFAULTS]

[aqt]
concurrency: 4
baseurl: https://ftp.fau.de/qtproject/
7zcmd: 7z
print_stacktrace_on_error: False
always_keep_archives: False
archive_download_location: .
min_module_size: 41

[requests]
connection_timeout: 3.5
response_timeout: 30
max_retries_on_connection_error: 5
retry_backoff: 0.1
max_retries_on_checksum_error: 5
max_retries_to_retrieve_hash: 5
hash_algorithm: sha1
INSECURE_NOT_FOR_PRODUCTION_ignore_hash: True

[mirrors]
trusted_mirrors:
    https://ftp.fau.de/qtproject/
blacklist:
    https://download.qt.io
    http://mirrors.ocf.berkeley.edu
    http://mirrors.tuna.tsinghua.edu.cn
    http://mirrors.geekpie.club
    https://master.qt.io/
fallbacks:
    https://qtproject.mirror.liquidtelecom.com/
    https://mirrors.aliyun.com/qt/
    https://mirrors.ustc.edu.cn/qtproject/
    https://ftp.jaist.ac.jp/pub/qtproject/
    https://ftp.yz.yamagata-u.ac.jp/pub/qtproject/
    https://qt-mirror.dannhauer.de/
    https://ftp.fau.de/qtproject/
    https://mirror.netcologne.de/qtproject/
    https://mirrors.dotsrc.org/qtproject/
    https://www.nic.funet.fi/pub/mirrors/download.qt-project.org/
    https://mirrors.ukfast.co.uk/sites/qt.io/
    https://ftp2.nluug.nl/languages/qt/
    https://ftp1.nluug.nl/languages/qt/
    https://qt.mirror.constant.com/

Expected behavior

Successful download of examples

aqt and python version

aqtinstall(aqt) v3.1.21 on Python 3.12.6 [CPython MSC v.1940 64 bit (AMD64)]

Operating System

Windows

Relevant log output

D:\>aqt install-example --outputdir D:\Qt2 windows 6.8.0
INFO    : aqtinstall(aqt) v3.1.21 on Python 3.12.6 [CPython MSC v.1940 64 bit (AMD64)]
ERROR   : cannot access local variable 'extensions_xml_text' where it is not associated with a value
Traceback (most recent call last):
  File "C:\Users\Vladimir\AppData\Local\Programs\Python\Python312\Lib\site-packages\aqt\installer.py", line 180, in run
    args.func(args)
  File "C:\Users\Vladimir\AppData\Local\Programs\Python\Python312\Lib\site-packages\aqt\installer.py", line 485, in run_install_example
    self._run_src_doc_examples("examples", args, cmd_name="example")
  File "C:\Users\Vladimir\AppData\Local\Programs\Python\Python312\Lib\site-packages\aqt\installer.py", line 444, in _run_src_doc_examples
    srcdocexamples_archives: SrcDocExamplesArchives = retry_on_bad_connection(
                                                      ^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Vladimir\AppData\Local\Programs\Python\Python312\Lib\site-packages\aqt\helper.py", line 176, in retry_on_bad_connection
    return function(base_url)
           ^^^^^^^^^^^^^^^^^^
  File "C:\Users\Vladimir\AppData\Local\Programs\Python\Python312\Lib\site-packages\aqt\installer.py", line 445, in <lambda>
    lambda base_url: SrcDocExamplesArchives(
                     ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Vladimir\AppData\Local\Programs\Python\Python312\Lib\site-packages\aqt\archives.py", line 612, in __init__
    super(SrcDocExamplesArchives, self).__init__(
  File "C:\Users\Vladimir\AppData\Local\Programs\Python\Python312\Lib\site-packages\aqt\archives.py", line 322, in __init__
    self._get_archives()
  File "C:\Users\Vladimir\AppData\Local\Programs\Python\Python312\Lib\site-packages\aqt\archives.py", line 647, in _get_archives
    self._get_archives_base(name, self._target_packages())
  File "C:\Users\Vladimir\AppData\Local\Programs\Python\Python312\Lib\site-packages\aqt\archives.py", line 447, in _get_archives_base
    if extensions_xml_text:
       ^^^^^^^^^^^^^^^^^^^
UnboundLocalError: cannot access local variable 'extensions_xml_text' where it is not associated with a value
ERROR   : aqtinstall(aqt) v3.1.21 on Python 3.12.6 [CPython MSC v.1940 64 bit (AMD64)]
Working dir: `D:\`
Arguments: `['C:\\Users\\Vladimir\\AppData\\Local\\Programs\\Python\\Python312\\Scripts\\aqt', 'install-example', '--outputdir', 'D:\\Qt2', 'windows', '6.8.0']` Host: `uname_result(system='Windows', node='MAIN-PC', release='11', version='10.0.22631', 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.

Code of Conduct

  • I agree to follow this project's Code of Conduct
@vserdyuk vserdyuk added bug Something isn't working triage labels Dec 23, 2024
@miurahr
Copy link
Owner

miurahr commented Dec 24, 2024

Thank you for the report.
I checked the code and the variable extensions_xml_text can be undefined when exception is occurred.

aqtinstall/aqt/archives.py

Lines 440 to 447 in 5ee98ef

extensions_xml_url = posixpath.join(extensions_target_folder, "Updates.xml")
# The extension may or may not exist for this version and arch.
try:
extensions_xml_text = self._download_update_xml(extensions_xml_url, True)
except ArchiveDownloadError:
# In case _download_update_xml ignores the hash and tries to get the url.
pass
if extensions_xml_text:

@miurahr
Copy link
Owner

miurahr commented Dec 24, 2024

The change of the chunk is by #852

miurahr added a commit that referenced this issue Dec 24, 2024
miurahr added a commit that referenced this issue Dec 24, 2024
miurahr added a commit that referenced this issue Dec 24, 2024
miurahr added a commit that referenced this issue Dec 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage
Projects
None yet
Development

No branches or pull requests

2 participants