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

KeyError: "clientid" #384

Open
1 of 3 tasks
SRK7Kyros opened this issue Jun 16, 2022 · 3 comments · May be fixed by #466
Open
1 of 3 tasks

KeyError: "clientid" #384

SRK7Kyros opened this issue Jun 16, 2022 · 3 comments · May be fixed by #466

Comments

@SRK7Kyros
Copy link

The problem

I get an error when I run api.drive.mkdir("NewFolder"), in attempt to create a folder in the root directory. I actually don't know if it's the right way to do it tho...

Environment

  • pyiCloud release with the issue (pip show pyicloud): 1.0.0
  • Last working pyiCloud release (if known):
  • Service causing this issue: Drive
  • Python version (python -V): 3.9.12
  • Operating environment (project deps/Docker/Windows/etc.): Windows 10

Traceback/Error logs

Traceback:
  File "C:\Users\(myuser)\anaconda3\lib\site-packages\pyicloud\services\drive.py", line 319, in mkdir
    return self.connection.create_folders(self.data["drivewsid"], folder)
  File "C:\Users\(myuser)\anaconda3\lib\site-packages\pyicloud\services\drive.py", line 169, in create_folders
    "clientId": self.params["clientId"]
KeyError: "clientid"

Checklist

  • I've looked informations into the README.
  • I've looked informations into the pyiCloud's code.
  • I've looked informations in Google.

Additional information

@SRK7Kyros
Copy link
Author

Update: Fixed by adding

self.params['clientId'] = self.client_id

to base.py, like so:

def drive(self):
        """Gets the 'Drive' service."""
        if not self._drive:
            self.params['clientId'] = self.client_id
            self._drive = DriveService(
                service_root=self._get_webservice_url("drivews"),
                document_root=self._get_webservice_url("docws"),
                session=self.session,
                params=self.params,
            )
        return self._drive

@scarlehoff
Copy link

I've tried doing this api._drive.params["clientId"] = api.client_id just before creating the folder and seems to work as well (to avoid having to modify base.py)

@ktechhydle
Copy link

@scarlehoff this didn't work for me, but I tried api.drive.params["clientId"] = api.client_id and I guess it works too. Seems like theres many ways to fix this.

ebob9 pushed a commit to ebob9/pyicloud that referenced this issue Nov 12, 2024
@ebob9 ebob9 linked a pull request Nov 12, 2024 that will close this issue
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants