Red-L / googlecl

Automatically exported from code.google.com/p/googlecl
0 stars 0 forks source link

Discovery authentication doesn't work (neither does --force-auth) #434

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
1. Remove your oauth2 token (as if you had never authorized)
    >  mv ~/.local/share/googlecl/dca_YOUREMAILHERE_tasks ~/tmp
2. Run `python src/google.py tasks tasks list`

Or you can just run:
python src/google.py tasks tasks list --force-auth

Expected output is asking for authentication and then a list of tasks.  
Instead you get an unexpected error:
    Uncaught error
    Traceback (most recent call last):
      File "src/google.py", line 987, in <module>
        main()
      File "src/google.py", line 973, in main
        run_once(options, args)
      File "src/google.py", line 668, in run_once
        discovery.run(init_args)
      File "/home/slackorama/projects/googlecl/src/googlecl/discovery/__init__.py", line 96, in run
        self.dataManager.client_id, self.dataManager.client_secret, force_auth)
      File "/home/slackorama/projects/googlecl/src/googlecl/discovery/authentication.py", line 55, in authenticate
        storage.put(None)
      File "/usr/local/lib/python2.7/dist-packages/oauth2client-1.0beta4-py2.7.egg/oauth2client/client.py", line 219, in put
        self.locked_put(credentials)
      File "/usr/local/lib/python2.7/dist-packages/oauth2client-1.0beta4-py2.7.egg/oauth2client/file.py", line 99, in locked_put
        f.write(credentials.to_json())
    AttributeError: 'NoneType' object has no attribute 'to_json'

Versions:
google-api-python-client-1.0beta4
oauth2client-1.0beta4

The problem is in src/googlecl/discovery/authentication.py on line 55.  If I 
remove that line, everything works fine and dandy. (diff attached)

Original issue reported on code.google.com by slackor...@gmail.com on 13 Oct 2011 at 6:02

Attachments:

GoogleCodeExporter commented 8 years ago
Thanks!  Fixed per your recommendation.

Original comment by jh...@google.com on 20 Oct 2011 at 2:45