flyfire / googlecl

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

IOError in write_access_token on Ubuntu Lucid #278

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. sudo apt-get install python-gdata
2. wget http://googlecl.googlecode.com/files/googlecl_0.9.10-1_all.deb
3. dpkg -i googlecl_0.9.10-1_all.deb
4. mkdir /root/.config
5. google docs list title,url-direct --delimiter ": "
6. Enter username
7. Enter username and password in w3m
8. After redirecting a few times, w3m shows "The page you requested is 
invalid". Quit w3m.
9. Now we can see the authentication URL. Visit it in Firefox on a computer 
with GUI.
10. Click "Grant Access".
11. Google says "You have successfully granted GoogleCL root@ubuntu access to 
your Google Account. You can revoke access at any time under 'My Account'. ". 
Go back to the command line, hit Enter.

What is the expected output? What do you see instead?

The error message:
$ google docs list title,url-direct --delimiter ": "
Did not find config / preferences file at /root/.config/googlecl/config
... making new one.
Please specify user: ********
Please log in and/or grant access via your browser at 
https://www.google.com/accounts/OAuthAuthorizeToken?oauth_token=********&hd=defa
ult then hit enter.
[Errno 2] No such file or directory: '/root/.local/share/googlecl'
Traceback (most recent call last):
  File "/usr/bin/google", line 676, in <module>
    main()
  File "/usr/bin/google", line 662, in main
    run_once(options, args)
  File "/usr/bin/google", line 488, in run_once
    success = authenticate(service, client, options.hostid)
  File "/usr/bin/google", line 115, in authenticate
    client.auth_token or client.current_token)
  File "/usr/lib/pymodules/python2.6/googlecl/__init__.py", line 381, in write_access_token
    with open(token_path, 'wb') as token_file:
IOError: [Errno 2] No such file or directory: ''

What version of the product are you using? On what operating system? What
version of gdata-python-client (aka python-gdata)?

Ubuntu 10.04 Server 64-bit
googlecl: 0.9.10-1_all
python-gdata: 1.2.4-0ubuntu2
python-support: 1.0.4ubuntu1

Please provide any additional information below.

Original issue reported on code.google.com by netv...@gmail.com on 6 Sep 2010 at 8:57

GoogleCodeExporter commented 8 years ago
python: 2.6.5-0ubuntu1

Original comment by netv...@gmail.com on 6 Sep 2010 at 9:24

GoogleCodeExporter commented 8 years ago
This would solve the problem:

mkdir -p /root/.local/share/

But now I get a different problem:

Traceback (most recent call last):
  File "/usr/bin/google", line 676, in <module>
    main()
  File "/usr/bin/google", line 662, in main
    run_once(options, args)
  File "/usr/bin/google", line 504, in run_once
    task.run(client, options, args)
  File "/usr/lib/pymodules/python2.6/googlecl/docs/base.py", line 485, in _run_list
    delimiter=options.delimiter)
  File "/usr/lib/pymodules/python2.6/googlecl/base.py", line 603, in compile_entry_string
    return_string += val.replace(delimiter, ' ') + delimiter
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe5 in position 0: ordinal 
not in range(128)

Original comment by netv...@gmail.com on 6 Sep 2010 at 9:58

GoogleCodeExporter commented 8 years ago
This issue was closed by revision r409.

Original comment by tom.h.mi...@gmail.com on 7 Sep 2010 at 8:19

GoogleCodeExporter commented 8 years ago
I've attached a patch that will fix this without using a mkdir command from the 
terminal.

P.S. the other error you're running into is Issue 279. I've just posted a patch 
for it in the issue tracker, so give that a shot. Thanks!

Original comment by tom.h.mi...@gmail.com on 7 Sep 2010 at 8:26

Attachments:

GoogleCodeExporter commented 8 years ago
Issue 282 has been merged into this issue.

Original comment by tom.h.mi...@gmail.com on 12 Sep 2010 at 6:43

GoogleCodeExporter commented 8 years ago
Issue 288 has been merged into this issue.

Original comment by tom.h.mi...@gmail.com on 21 Sep 2010 at 11:50