-
Notifications
You must be signed in to change notification settings - Fork 980
Description
Describe the bug
I tried to use the sheet = gc.open_by_url() function to access a xlsx that was shared with my account (My email got full access to the document, not via shared url). The credentials are correctly configure on the email that has permissions, but the email is not the owner.
The documnet is a .XLXS can this be the problem?
The error i get:
gspread.exceptions.APIError: {'code': 400, 'message': 'This operation is not supported for this document', 'status': 'FAILED_PRECONDITION'}
To Reproduce
Steps to reproduce the behavior:
- Create a document on an account X
- Share it with an account Y
- Configure the API on the account Y
- Try to access the file created by X
Expected behavior
I expect the file to open as if I am the owner of it.
Code example*
If applicable, provide a code example to help explain your problem.
Environment info:
- Operating System [e.g. Linux, Windows, macOS]: Linux
- Python version: 3.6.9
- gspread version: 3.3.0
Stack trace or other output that would be helpful
Traceback (most recent call last):
File "/home/vlad/Documents/Projects/SYneto/tutorials/GoogleDrTest/.venv/lib/python3.6/site-packages/gspread/models.py", line 90, in title
return self._properties['title']
KeyError: 'title'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "drive.py", line 26, in
downlaodSheetFile()
File "/home/vlad/Documents/Projects/SYneto/tutorials/GoogleDrTest/operations/downloader.py", line 61, in downlaodSheetFile
print(sheet)
File "/home/vlad/Documents/Projects/SYneto/tutorials/GoogleDrTest/.venv/lib/python3.6/site-packages/gspread/models.py", line 121, in repr
repr(self.title),
File "/home/vlad/Documents/Projects/SYneto/tutorials/GoogleDrTest/.venv/lib/python3.6/site-packages/gspread/models.py", line 92, in title
metadata = self.fetch_sheet_metadata()
File "/home/vlad/Documents/Projects/SYneto/tutorials/GoogleDrTest/.venv/lib/python3.6/site-packages/gspread/models.py", line 255, in fetch_sheet_metadata
r = self.client.request('get', url, params=params)
File "/home/vlad/Documents/Projects/SYneto/tutorials/GoogleDrTest/.venv/lib/python3.6/site-packages/gspread/client.py", line 79, in request
raise APIError(response)
gspread.exceptions.APIError: {'code': 400, 'message': 'This operation is not supported for this document', 'status': 'FAILED_PRECONDITION'}