Closed GoogleCodeExporter closed 8 years ago
I just went right for the config file :)
Try applying this patch and adding an option called "default_encoding = utf-8"
to the GENERAL section of your config file (~/.config/googlecl/config). Please
let me know if it does or does not work.
Original comment by tom.h.mi...@gmail.com
on 14 Feb 2011 at 1:17
Attachments:
Unfortunately, there appears to be something wrong with that patch:
Traceback (most recent call last):
File "/usr/bin/google", line 54, in <module>
import googlecl
File "/usr/lib/pymodules/python2.6/googlecl/__init__.py", line 70, in <module>
TERMINAL_ENCODING = determine_terminal_encoding()
File "/usr/lib/pymodules/python2.6/googlecl/__init__.py", line 52, in determine_terminal_encoding
return_enc = googlecl.config.parser.safe_get('GENERAL',
AttributeError: 'module' object has no attribute 'safe_get'
Original comment by eckho...@gmail.com
on 14 Feb 2011 at 9:39
Whoops. This patch (applied to 0.9.12) should actually fix the problem. If you
applied the patch from comment 1, you'll have to remove it.
There may be some garbled characters as GoogleCL gets started, but the output
you want from the cron job should come through.
Again, let me know if something's wrong. Thanks for the quick report turnaround!
Original comment by tom.h.mi...@gmail.com
on 17 Feb 2011 at 3:21
Attachments:
Hey. Thanks again for your effort. However, it seems when
determine_terminal_encoding is called on module initialization (without config)
something goes wrong now.
Traceback (most recent call last):
File "/usr/bin/google", line 54, in <module>
import googlecl
File "/usr/lib/pymodules/python2.6/googlecl/__init__.py", line 75, in <module>
TERMINAL_ENCODING = determine_terminal_encoding()
File "/usr/lib/pymodules/python2.6/googlecl/__init__.py", line 55, in determine_terminal_encoding
if not return_enc:
UnboundLocalError: local variable 'return_enc' referenced before assignment
When I add "return_enc = 'utf-8'" before "if config is not None" (to see what
happens when the function is called the second time) I get this:
Traceback (most recent call last):
File "/usr/bin/google", line 839, in <module>
main()
File "/usr/bin/google", line 825, in main
run_once(options, args)
File "/usr/bin/google", line 530, in run_once
options.config)
File "/usr/bin/google", line 354, in import_service
config = googlecl.config.load_configuration(config_file_path)
File "/usr/lib/pymodules/python2.6/googlecl/config/__init__.py", line 89, in load_configuration
googlecl.TERMINAL_ENCODING = googlecl.determine_terminal_encoding(config)
File "/usr/lib/pymodules/python2.6/googlecl/__init__.py", line 54, in determine_terminal_encoding
return_enc = config.parser.safe_get('GENERAL',
AttributeError: ConfigParser instance has no attribute 'safe_get'
Original comment by eckho...@gmail.com
on 22 Feb 2011 at 10:58
Thanks for your patience with this. I've heard the third time is the charm, so
here's the third version of that patch (again applied to 0.9.12 directly).
(Your instinct with return_enc was right, but unfortunately I had a typo with
the config code, also fixed in this patch)
Original comment by tom.h.mi...@gmail.com
on 9 Mar 2011 at 3:40
Attachments:
Your latest patch indeed fixes the issue. Thanks.
Original comment by eckho...@gmail.com
on 13 Mar 2011 at 6:38
Finally! Sorry for all the botched attempts.
Closed by r542.
Original comment by tom.h.mi...@gmail.com
on 18 Mar 2011 at 12:51
Original issue reported on code.google.com by
eckho...@gmail.com
on 8 Feb 2011 at 10:36