question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

JSONDecodeError when running `api.files.dir()`

See original GitHub issue

Before running api.files.dir(), I authenticate and test using api.devices. Everything checks out.

Then, I run:

>>> api.files.dir()

and get:

  File "<stdin>", line 1, in <module>
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pyicloud/services/ubiquity.py", line 48, in __getattr__
    return getattr(self.root, attr)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pyicloud/services/ubiquity.py", line 44, in root
    self._root = self.get_node(0)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pyicloud/services/ubiquity.py", line 25, in get_node
    return UbiquityNode(self, request.json())
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/requests/models.py", line 894, in json
    return complexjson.loads(self.text, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/json/__init__.py", line 354, in loads
    return _default_decoder.decode(s)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/json/decoder.py", line 339, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/json/decoder.py", line 357, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

I did some shallow digging and ran:

>>> api.files._root is None
True

Has anyone seen this before? Is there a fix for this? I tested with python3.6 and python2.7. Let me know if I should provide more info.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
chadjcommented, May 9, 2018

The back-end for the files api changed awhile back and needs to be reimplemented. pyicloud can’t currently work with iCloud drive files.

@avanalfen This response is late but install directly from github to get a version of pyicloud that works with the new Photo’s backend.

$ pip install git+https://github.com/picklepete/pyicloud
0reactions
Quentamecommented, Mar 20, 2020

Seems to have the solution in #166.

Please create a new issue if still exists.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why am I getting a JSONDecodeError when trying to load a ...
I'm trying to load a JSON file in to Python, but it's giving me an JSONDecodeError error which seems to suggest the file...
Read more >
5/20 pipelines fail with JSONDecodeError · Issue #202 - GitHub
I restarted the workflows with identical input JSON files and identical commands using the file DBs, and they finished without error. Is there ......
Read more >
Python JSON tricks: how to deal with JSONDecodeError
Trick 1: You should use double quotes for keys and values, otherwise you will have the JSONDecodeError error: To solve this error, you...
Read more >
Question about converting Twitter Search API JSON file to CSV
Need to convert a JSON file to CSV, and the JSON file was downloaded from the Twitter Search API using twarc2. Twarc search...
Read more >
Azure Databricks CLI "Error: JSONDecodeError - Endjin
Have you been trying to create a Databricks cluster using the CLI? ... required to pass in either a JSON string or a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found