Skip to content

argument of type 'NoneType' is not iterable (ikhal) #261

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
gour opened this issue Sep 7, 2015 · 12 comments
Closed

argument of type 'NoneType' is not iterable (ikhal) #261

gour opened this issue Sep 7, 2015 · 12 comments

Comments

@gour
Copy link

gour commented Sep 7, 2015

Invoking ikhal gives:

(vdir)gour@atmarama ~/p/vdir> ikhal -a gour
Traceback (most recent call last):
  File "/home/gour/prj/vdir/bin/ikhal", line 9, in <module>
    load_entry_point('khal==0.6.1.dev83+nge9717c8', 'console_scripts', 'ikhal')()
  File "/home/gour/prj/vdir/local/lib/python2.7/site-packages/click/core.py", line 700, in __call__
    return self.main(*args, **kwargs)
  File "/home/gour/prj/vdir/local/lib/python2.7/site-packages/click/core.py", line 679, in main
    with self.make_context(prog_name, args, **extra) as ctx:
  File "/home/gour/prj/vdir/local/lib/python2.7/site-packages/click/core.py", line 594, in make_context
    self.parse_args(ctx, args)
  File "/home/gour/prj/vdir/local/lib/python2.7/site-packages/click/core.py", line 858, in parse_args
    value, args = param.handle_parse_result(ctx, opts, args)
  File "/home/gour/prj/vdir/local/lib/python2.7/site-packages/click/core.py", line 1362, in handle_parse_result
    self.callback, ctx, self, value)
  File "/home/gour/prj/vdir/local/lib/python2.7/site-packages/click/core.py", line 56, in invoke_param_callback
    return callback(ctx, param, value)
  File "/home/gour/prj/vdir/local/lib/python2.7/site-packages/khal/cli.py", line 58, in _multi_calendar_select_callback
    if 'calendar_selection' in ctx.obj:
TypeError: argument of type 'NoneType' is not iterable

while invoking:

khal interactive -a gour

does work.

Any hint?

@geier
Copy link
Member

geier commented Sep 22, 2015

Not really. Which version of click have you installed?

@untitaker Could you perhaps take a look at this? It looks like a click issue to me.

@untitaker
Copy link
Member

I can't reproduce this at all. Not sure if a click issue, there were some problems like that but there were quite a few versions inbetween. The fix for those must've been around for months.

@gour Could you try pip install -U khal click for your virtualenv?

@untitaker
Copy link
Member

Oh god, nevermind, I can reproduce this.

@untitaker
Copy link
Member

Yeah, you set up the context within interactive, but that's too late because the options are parsed before that, and those rely on ctx.

@untitaker
Copy link
Member

Might be that I wrote this code, will fix.

@geier
Copy link
Member

geier commented Sep 22, 2015

Quoting Markus Unterwaditzer (2015-09-22 23:22:55)

Might be that I wrote this code, will fix.

probably, as I never understood how click works...

Thanks for taking care of this, but still strange that it does work for
me...

@untitaker
Copy link
Member

I think this is fixed now.

@geier
Copy link
Member

geier commented Sep 22, 2015

Thank you!

@gour could you have a look as well?

@gour
Copy link
Author

gour commented Sep 23, 2015

(vdir)gour@atmarama ~/p/vdir> pip list
argparse (1.2.1)
atomicwrites (0.1.5)
click (5.1)
configobj (5.0.6)
icalendar (3.9.1)
khal (0.6.1.dev83+nge9717c8)
khard (0.4.1)
lxml (3.4.4)
pip (1.5.6)
pkginfo (1.2.1)
python-dateutil (2.4.2)
pytz (2015.6)
pyxdg (0.25)
requests (2.7.0)
requests-toolbelt (0.4.0)
setuptools (18.3.2)
six (1.9.0)
tzlocal (1.2)
urwid (1.3.0)
vdirsyncer (0.6.0)
vobject (0.6.6)
wsgiref (0.1.2)

and

(vdir)gour@atmarama ~/p/vdir> ikhal -v 
debug: using the config file at /home/gour/.config/khal/khal.conf
debug: khal 0.6.1.dev83+nge9717c8
debug: Using config:
debug: [calendars]
debug:   [[gour]]
debug:     path: /home/gour/prj/vdir/calendars/gour-calendar/
debug:     color: light blue
debug:     readonly: False
debug:     type: calendar
debug:   [[jahnava]]
debug:     path: /home/gour/prj/vdir/calendars/jahnava-calendar/
debug:     color: dark magenta
debug:     readonly: False
debug:     type: calendar
debug:   [[birthdays]]
debug:     path: /home/gour/prj/vdir/calendars/contact_birthdays/
debug:     color: 
debug:     readonly: False
debug:     type: calendar
debug: [locale]
debug:   local_timezone: Europe/Zagreb
debug:   default_timezone: Europe/Zagreb
debug:   timeformat: %H:%M
debug:   dateformat: %d.%m.
debug:   longdateformat: %d.%m.%Y
debug:   datetimeformat: %d.%m. %H:%M
debug:   longdatetimeformat: %d.%m.%Y %H:%M
debug:   encoding: utf-8
debug:   firstweekday: 0
debug:   unicode_symbols: True
debug:   weeknumbers: False
debug: [sqlite]
debug:   path: /home/gour/.local/share/khal/khal.db
debug: [keybindings]
debug:   up: ['up', 'k']
debug:   down: ['down', 'j']
debug:   right: ['right', 'l', ' ']
debug:   left: ['left', 'h', 'backspace']
debug:   new: ['n']
debug:   delete: ['d']
debug:   view: ['enter', 'tab']
debug:   today: ['t']
debug:   save: ['meta enter']
debug: [default]
debug:   default_command: calendar
debug:   default_calendar: None
debug:   show_all_days: False
debug:   days: 2
debug:   print_new: False
debug: [view]
debug:   event_view_weighting: 1
debug:   event_view_always_visible: False
debug:   theme: dark
debug:   frame: False
debug: created version table
debug: tables for calendar gour exist
debug: created version table
debug: tables for calendar jahnava exist
debug: created version table
debug: tables for calendar birthdays exist

does work, but this one does not:

vdir)gour@atmarama ~/p/vdir> ikhal -v -a gour
Traceback (most recent call last):
  File "/home/gour/prj/vdir/bin/ikhal", line 9, in <module>
    load_entry_point('khal==0.6.1.dev83+nge9717c8', 'console_scripts', 'ikhal')()
  File "/home/gour/prj/vdir/local/lib/python2.7/site-packages/click/core.py", line 700, in __call__
    return self.main(*args, **kwargs)
  File "/home/gour/prj/vdir/local/lib/python2.7/site-packages/click/core.py", line 679, in main
    with self.make_context(prog_name, args, **extra) as ctx:
  File "/home/gour/prj/vdir/local/lib/python2.7/site-packages/click/core.py", line 594, in make_context
    self.parse_args(ctx, args)
  File "/home/gour/prj/vdir/local/lib/python2.7/site-packages/click/core.py", line 858, in parse_args
    value, args = param.handle_parse_result(ctx, opts, args)
  File "/home/gour/prj/vdir/local/lib/python2.7/site-packages/click/core.py", line 1362, in handle_parse_result
    self.callback, ctx, self, value)
  File "/home/gour/prj/vdir/local/lib/python2.7/site-packages/click/core.py", line 56, in invoke_param_callback
    return callback(ctx, param, value)
  File "/home/gour/prj/vdir/local/lib/python2.7/site-packages/khal/cli.py", line 58, in _multi_calendar_select_callback
    if 'calendar_selection' in ctx.obj:
TypeError: argument of type 'NoneType' is not iterable

@geier geier reopened this Sep 23, 2015
@geier geier mentioned this issue Sep 23, 2015
@untitaker
Copy link
Member

Both commands work for me. I don't know how you made ikhal -v print the version number, it doesn't do that for me.

$ ikhal --version
ikhal, version 0.6.1.dev85+ng2c7096f.d20150922

Your version (khal 0.6.1.dev83+nge9717c8) seems to be a few commits behind.

@gour
Copy link
Author

gour commented Sep 23, 2015

Your version (khal 0.6.1.dev83+nge9717c8) seems to be a few commits behind.

Indeed...issuing:

pip install -U khal click

didn't help, but installing master - 17d3bf1- solved the issue. :-)

@untitaker
Copy link
Member

Yeah we haven't released a new version yet.

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

No branches or pull requests

3 participants