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

NameError: name 'PyiCloudConnectionException' is not defined. Did you mean: 'PyiCloudFailedLoginException'? #836

Closed
boredazfcuk opened this issue May 16, 2024 · 1 comment
Labels

Comments

@boredazfcuk
Copy link
Contributor

Overview

In the past few weeks I've had a few users report the following error:

NameError: name 'PyiCloudConnectionException' is not defined. Did you mean: 'PyiCloudFailedLoginException'?

Steps to Reproduce

They seem to report this when initialising their container/saving their password.

Expected Behavior

For this crash not to occur

Actual Behavior

Error crashes application before downloads begin.

Context

After looking at the code in base.py, it seems to be attempting to call an exception related to an incorrectly configured domain parameter:

        # {'domainToUse': 'iCloud.com'}
        domain_to_use = self.data.get('domainToUse')
        if domain_to_use != None:
            msg = f'Apple insists on using {domain_to_use} for your request. Please use --domain parameter'
            raise PyiCloudConnectionException(msg)

The error suggests that this exception does not exist:

File "starters/icloud.py", line 5, in
File "pyicloud_ipd/cmdline.py", line 200, in main
File "pyicloud_ipd/base.py", line 305, in init
File "pyicloud_ipd/base.py", line 367, in authenticate
File "pyicloud_ipd/base.py", line 399, in _authenticate_with_token
NameError: name 'PyiCloudConnectionException' is not defined. Did you mean: 'PyiCloudFailedLoginException'?
[424] Failed to execute script 'icloud' due to unhandled exception!

However I did find it in exceptions.py:

# Potentially Deprecated - Further review needed
class PyiCloudConnectionException(PyiCloudException):
    pass

Once upon a time, if a user attempted to connect to the authentication servers in China, but had not specified the --domain parameter, they would receive the Apple insists on using {domain_to_use} for your request. Please use --domain parameter' error message. I think that this isn't happening any more, for some reason.

AndreyNikiforov added a commit to AndreyNikiforov/icloud_photos_downloader that referenced this issue May 23, 2024
AndreyNikiforov added a commit that referenced this issue May 23, 2024
* bump mypy 1.7.0->1.10.0

* fix missing exception #836

* add hidden imports pyinstaller/pyinstaller#8554

* bump pyinstaller 5.13.2 -> 6.7.0
@AndreyNikiforov
Copy link
Collaborator

v1.17.6 is expected to resolve the issue. reopen the issue if not

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants