ListFile returns empty?
Hi,
I am trying find the id and title of files and folder inside my google drive, so i am using ListFile(). However I am getting empty list( but I can use CreateFile(), Upload() etc to get upload new files). Here is the code,
file_list = drive.ListFile({'q': "'root' in parents and trashed=false"}).GetList()
for file1 in file_list:
print('title: %s, id: %s' % (file1['title'], file1['id']))
What should I do to resolve this issue?
Are you using automatic authentication?
I'm having same issue. @MateoWartelle, yes I'm using automatic authentication
Confirm the same bug. Using automatic auth. Work without automatic auth. CreateFile() and Upload() work well. PyDrive==1.3.1
I also encounter the same problem with automatic auth. As Ikrcal says, CreateFile() and Upload() work well for me also.
Same here, it seems to list only the files created by the current app, even when not using automatic OAuth
I have the same bug
I have the same bug.
Most files return file info, always. but, some file couldn't return file info, always....
Same here, it seems to list only the files created by the current app, even when not using automatic OAuth Same here, is this by design or it's a bug?
Any updates to this? I'm also getting an empty list when using FileList.
Same problem here using automated authentication via the settings.yaml, verified to work as expected when using the LocalWebserverAuth(). I ended up working around this by using a service account and then sharing a specific folder.
Ill revisit and open a PR
Ill revisit and open a PR
Hello @MateoWartelle, can you please provide the link to the PR please ?
thank you very much !
I just had the same issue. When playing around, I had created a settings.yaml by copying the sample one here: https://pythonhosted.org/PyDrive/oauth.html#sample-settings-yaml
I noticed that when granting permissions in the Google auth page, it said something along the lines of This application requests permission to create/delete/list files created by the app, which explains why it wouldn't be able to see files not created by the app.
Removing the oauth_scope: entry from the sample settings (So it just uses the default https://www.googleapis.com/auth/drive solved the issue for me (which grants it permission for everything).
I just had the same issue. When playing around, I had created a
settings.yamlby copying the sample one here: https://pythonhosted.org/PyDrive/oauth.html#sample-settings-yamlI noticed that when granting permissions in the Google auth page, it said something along the lines of
This application requests permission to create/delete/list files created by the app, which explains why it wouldn't be able to see files not created by the app.Removing the
oauth_scope:entry from the sample settings (So it just uses the defaulthttps://www.googleapis.com/auth/drivesolved the issue for me (which grants it permission for everything).
This worked for me, I use automatic authentication. For it to work you'd have to delete your credentials.json file and run the authentication code again