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

[main] an error appear in logs: TypeError: 'NoneType' object is not iterable (in DownloadManager.set_proxy_settings) #8040

Closed
kozlovsky opened this issue May 27, 2024 · 0 comments · Fixed by #8041
Assignees

Comments

@kozlovsky
Copy link
Contributor

In the main branch, the following traceback appears in logs after #8033:

ERROR <download_manager:391> DownloadManager.set_proxy_settings(): 'NoneType' object is not iterable
Traceback (most recent call last):
  File "C:\dev\tribler\src\tribler\core\components\libtorrent\download_manager\download_manager.py", line 384, in set_proxy_settings
    if not all(v is not None for v in auth):
TypeError: 'NoneType' object is not iterable

It appears here:

        try:
            if not all(v is not None for v in auth):
                raise ValueError('Username and password should not be None')

            username, proxy_password = auth
            settings["proxy_username"] = username
            settings["proxy_password"] = proxy_password
        except (ValueError, TypeError) as e:
            self._logger.exception(e)

This is actually not an unhandled error but a part of a normal process, but it looks confusing. In a normal situation, the process should not write errors to the stderr and to the error log. I suggest handling it without raising an error.

kozlovsky added a commit to kozlovsky/tribler that referenced this issue May 27, 2024
@kozlovsky kozlovsky self-assigned this May 27, 2024
kozlovsky added a commit that referenced this issue May 27, 2024
…ling

Fixes #8040: improved error handling in set_proxy_settings
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

1 participant