gcalcli: Crash on start (ValueError: unknown locale: UTF-8)

Hey, really cool tool!

Sadly, it crashes right at the beginning for me.

Mac OS X: Yosemite 10.10.2 Python: 2.7.10

Traceback:

Traceback (most recent call last):
  File "/usr/local/bin/gcalcli", line 2555, in <module>
    BowChickaWowWow()
  File "/usr/local/bin/gcalcli", line 2406, in BowChickaWowWow
    gcal.AgendaQuery()
  File "/usr/local/bin/gcalcli", line 1670, in AgendaQuery
    self._IterateEvents(start, eventList, yearDate=False)
  File "/usr/local/bin/gcalcli", line 1518, in _IterateEvents
    self._PrintEvent(event, prefix)
  File "/usr/local/bin/gcalcli", line 1228, in _PrintEvent
    (tmpTimeStr, self._ValidTitle(event).strip()))
  File "/usr/local/bin/gcalcli", line 415, in PrintMsg
    msg = stringFromUnicode(msg)
  File "/usr/local/bin/gcalcli", line 228, in stringFromUnicode
    return string.encode(locale.getlocale()[1] or
  File "/usr/local/Cellar/python/2.7.10/Frameworks/Python.framework/Versions/2.7/lib/python2.7/locale.py", line 562, in getlocale
    return _parse_localename(localename)
  File "/usr/local/Cellar/python/2.7.10/Frameworks/Python.framework/Versions/2.7/lib/python2.7/locale.py", line 475, in _parse_localename
    raise ValueError, 'unknown locale: %s' % localename
ValueError: unknown locale: UTF-8

+1 for BowChickaWowWow() 😃

Regards, Sebastian

About this issue

  • Original URL
  • State: open
  • Created 9 years ago
  • Reactions: 2
  • Comments: 17

Most upvoted comments

@jcrowgey Just want to confirm that this is still a problem with girt master if export LC_CTYPE=en_US.UTF-8 is not set, just like you expected.

@jcrowgey

  1. The output of locale was:
ANG=
LC_COLLATE="C"
LC_CTYPE="UTF-8"
LC_MESSAGES="C"
LC_MONETARY="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_ALL=

Hmmm, so it seems that I did not have a locale set. Not sure how that happened.

  1. After running export LANG=en_US.UTF-8, the output of locale was:
LANG="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_CTYPE="UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_ALL=

And gcalcli was still crashing if ran without --locale argument.

  1. So then I exported export LC_CTYPE=en_US.UTF-8 directly and gcalcli started working fine even if run without --locale.

Does this help or you still want me to try building and running from master branch?