Skip to content

UnboundLocalError: local variable 'parent' referenced before assignment #105

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jasonwryan opened this issue Aug 25, 2014 · 3 comments
Closed

Comments

@jasonwryan
Copy link
Contributor

Updated khal and vdirsyncer to the latest git versions, installed python2-configobj and updated my config file to the new format, removed the old khal.db and when I start khal I get:

Traceback (most recent call last):
  File "/usr/bin/khal", line 9, in <module>
    load_entry_point('khal==0.3.0.dev-53-g6663c9d', 'console_scripts', 'khal')()
  File "/usr/lib/python2.7/site-packages/khal/cli.py", line 88, in main_khal
    conf = get_config(arguments['-c'])
  File "/usr/lib/python2.7/site-packages/khal/settings/settings.py", line 89, in get_config
    file_error=True,
  File "/usr/lib/python2.7/site-packages/configobj.py", line 1229, in __init__
    self._load(infile, configspec)
  File "/usr/lib/python2.7/site-packages/configobj.py", line 1304, in _load
    self._parse(content)
  File "/usr/lib/python2.7/site-packages/configobj.py", line 1608, in _parse
    if sect_name in parent:
UnboundLocalError: local variable 'parent' referenced before assignment

As far as I can tell, my config is correct:

#------------------------------------------------------
# ## CalDAV Account Configuration ##
#------------------------------------------------------

[[calendars]]
[work]
path = ~/.config/vdir/calendars/work/
color = dark blue

[holidays]
path = ~/.config/vdir/calendars/holidays/
color = light green

[sqlite]
path = ~/.config/khal/khal.db

[locale]
local_timezone = Pacific/Auckland
default_timezone = Pacific/Auckland

timeformat = %H:%M
dateformat = %d-%m
longdateformat = %Y-%m-%d
datetimeformat = %d-%m %H:%M
longdatetimeformat = %Y-%m-%d %H:%M

firstweekday = 0
encoding = utf-8
unicode_symbols = True

[default]
default_command = calendar
default_calendar = work
debug = 0
@untitaker
Copy link
Member

Ha.. the example config file is still incorrect.

@untitaker
Copy link
Member

So basically you need to use [[ for calendar headings and [ for everything else. Sorry about that.

@jasonwryan
Copy link
Contributor Author

Sweet: thanks

Oops: example conf is still missing a bracket (line 3)...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants