gcalcli icon indicating copy to clipboard operation
gcalcli copied to clipboard

UnicodeEncodeError when using conky, etc

Open watho opened this issue 6 years ago • 6 comments

I tried the masterbranch to use the new option lineart=unicode (see #97) inside conky. There is a regression when calling gcalcli inside conky script independent of any lineart settings. e.g. {execpi 120 gcalcli --conky agenda}\

The following error happens for me

UnicodeEncodeError: 'ascii' codec can't encode character u'\xe4' in position 23: ordinal not in range(128)
Traceback (most recent call last):
  File "/usr/local/bin/gcalcli", line 9, in <module>
    load_entry_point('gcalcli==4.0.0a5', 'console_scripts', 'gcalcli')()
  File "build/bdist.linux-x86_64/egg/gcalcli/gcalcli.py", line 1611, in main
  File "build/bdist.linux-x86_64/egg/gcalcli/gcalcli.py", line 1167, in AgendaQuery
  File "build/bdist.linux-x86_64/egg/gcalcli/gcalcli.py", line 1151, in _display_queried_events
  File "build/bdist.linux-x86_64/egg/gcalcli/gcalcli.py", line 1033, in _iterate_events
  File "build/bdist.linux-x86_64/egg/gcalcli/gcalcli.py", line 729, in _PrintEvent
  File "build/bdist.linux-x86_64/egg/gcalcli/printer.py", line 91, in msg
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe4' in position 23: ordinal not in range(128)

The failing character is the german umlaut ü.

No error when running it in normal bash terminal. No error with v3.4.0 inside conky besides #97 .

watho avatar Sep 11 '18 15:09 watho