You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 22, 2021. It is now read-only.
Hello, everyone! I was following the quickstart guide on PyDrive, downloaded client_secret_.json. file, renamed it and encountered the following issue:
from pydrive.auth import GoogleAuth
gauth = GoogleAuth()
gauth.LocalWebserverAuth()
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xcf in position 0: invalid continuation byte
Tried to change encoding to latin-1:
import codecs
BLOCKSIZE = 1048576 # or some other, desired size in bytes
with codecs.open(source_path, "r", "utf-8") as sourceFile:
with codecs.open('client_secrets.json', "w", "latin-1") as targetFile:
while True:
contents = sourceFile.read(BLOCKSIZE)
if not contents:
break
targetFile.write(contents)
But after this it throws another error: JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Could you help me to find out what causes these errors and how to properly authenticate with PyDrive?
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hello, everyone! I was following the quickstart guide on PyDrive, downloaded client_secret_.json. file, renamed it and encountered the following issue:
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xcf in position 0: invalid continuation byte
Tried to change encoding to latin-1:
But after this it throws another error:
JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Could you help me to find out what causes these errors and how to properly authenticate with PyDrive?
The text was updated successfully, but these errors were encountered: