|
with open(credentials_path, 'w', encoding='utf-8') as token: |
Adding a mode argument to the open() call will make sure the credential file is created with safe(r) permissions depending on umask os settings. Without the mode argument the credential file could be created world readable.