{"action":"created","issue":{"url":"https://api.github.com/repos/geier/khal/issues/323","labels_url":"https://api.github.com/repos/geier/khal/issues/323/labels{/name}","comments_url":"https://api.github.com/repos/geier/khal/issues/323/comments","events_url":"https://api.github.com/repos/geier/khal/issues/323/events","html_url":"https://github.com/geier/khal/issues/323","id":125823598,"number":323,"title":"KeyError on construction of floating/all-day event.","user":{"login":"JKatzwinkel","id":1922142,"avatar_url":"https://avatars.githubusercontent.com/u/1922142?v=3","gravatar_id":"","url":"https://api.github.com/users/JKatzwinkel","html_url":"https://github.com/JKatzwinkel","followers_url":"https://api.github.com/users/JKatzwinkel/followers","following_url":"https://api.github.com/users/JKatzwinkel/following{/other_user}","gists_url":"https://api.github.com/users/JKatzwinkel/gists{/gist_id}","starred_url":"https://api.github.com/users/JKatzwinkel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JKatzwinkel/subscriptions","organizations_url":"https://api.github.com/users/JKatzwinkel/orgs","repos_url":"https://api.github.com/users/JKatzwinkel/repos","events_url":"https://api.github.com/users/JKatzwinkel/events{/privacy}","received_events_url":"https://api.github.com/users/JKatzwinkel/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/geier/khal/labels/bug","name":"bug","color":"e11d21"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-01-10T14:42:47Z","updated_at":"2016-01-11T11:22:49Z","closed_at":null,"body":"Only on certain events, `khal` crashes like this:\r\n\r\n\t\tTraceback (most recent call last):\r\n\t\t\tFile \"/usr/bin/khal\", line 9, in <module>\r\n\t\t\t\tload_entry_point('khal==0.7.1.dev41+ng699b6c3.d20160108', 'console_scripts', 'khal')()\r\n\t\t\tFile \"/usr/lib/python3.5/site-packages/click/core.py\", line 716, in __call__\r\n\t\t\t\treturn self.main(*args, **kwargs)\r\n\t\t\tFile \"/usr/lib/python3.5/site-packages/click/core.py\", line 696, in main\r\n\t\t\t\trv = self.invoke(ctx)\r\n\t\t\tFile \"/usr/lib/python3.5/site-packages/click/core.py\", line 1037, in invoke\r\n\t\t\t\treturn Command.invoke(self, ctx)\r\n\t\t\tFile \"/usr/lib/python3.5/site-packages/click/core.py\", line 889, in invoke\r\n\t\t\t\treturn ctx.invoke(self.callback, **ctx.params)\r\n\t\t\tFile \"/usr/lib/python3.5/site-packages/click/core.py\", line 534, in invoke\r\n\t\t\t\treturn callback(*args, **kwargs)\r\n\t\t\tFile \"/usr/lib/python3.5/site-packages/click/decorators.py\", line 17, in new_func\r\n\t\t\t\treturn f(get_current_context(), *args, **kwargs)\r\n\t\t\tFile \"/usr/lib/python3.5/site-packages/khal-0.7.1.dev41+ng699b6c3.d20160108-py3.5.egg/khal/cli.py\", line 227, in cli\r\n\t\t\t\tctx.invoke(cli.commands[command])\r\n\t\t\tFile \"/usr/lib/python3.5/site-packages/click/core.py\", line 534, in invoke\r\n\t\t\t\treturn callback(*args, **kwargs)\r\n\t\t\tFile \"/usr/lib/python3.5/site-packages/click/decorators.py\", line 17, in new_func\r\n\t\t\t\treturn f(get_current_context(), *args, **kwargs)\r\n\t\t\tFile \"/usr/lib/python3.5/site-packages/khal-0.7.1.dev41+ng699b6c3.d20160108-py3.5.egg/khal/cli.py\", line 255, in calendar\r\n\t\t\t\tfull=full\r\n\t\t\tFile \"/usr/lib/python3.5/site-packages/khal-0.7.1.dev41+ng699b6c3.d20160108-py3.5.egg/khal/controllers.py\", line 148, in calendar\r\n\t\t\t\tlocale=locale)\r\n\t\t\tFile \"/usr/lib/python3.5/site-packages/khal-0.7.1.dev41+ng699b6c3.d20160108-py3.5.egg/khal/calendar_display.py\", line 184, in vertical_month\r\n\t\t\t\tmultiple, color, highlight_event_days, locale)\r\n\t\t\tFile \"/usr/lib/python3.5/site-packages/khal-0.7.1.dev41+ng699b6c3.d20160108-py3.5.egg/khal/calendar_display.py\", line 128, in str_week\r\n\t\t\t\tdevents = list(collection.get_events_on(day))\r\n\t\t\tFile \"/usr/lib/python3.5/site-packages/khal-0.7.1.dev41+ng699b6c3.d20160108-py3.5.egg/khal/khalendar/khalendar.py\", line 317, in <genexpr>\r\n\t\t\t\treturn (self._cover_event(event) for event in events)\r\n\t\t\tFile \"/usr/lib/python3.5/site-packages/khal-0.7.1.dev41+ng699b6c3.d20160108-py3.5.egg/khal/khalendar/backend.py\", line 433, in get_floating\r\n\t\t\t\tyield self.construct_event(item, href, start, end, ref, etag, calendar, dtype)\r\n\t\t\tFile \"/usr/lib/python3.5/site-packages/khal-0.7.1.dev41+ng699b6c3.d20160108-py3.5.egg/khal/khalendar/backend.py\", line 515, in construct_event\r\n\t\t\t\tref=ref,\r\n\t\t\tFile \"/usr/lib/python3.5/site-packages/khal-0.7.1.dev41+ng699b6c3.d20160108-py3.5.egg/khal/khalendar/event.py\", line 143, in fromString\r\n\t\t\t\treturn cls.fromVEvents(events, ref, **kwargs)\r\n\t\t\tFile \"/usr/lib/python3.5/site-packages/khal-0.7.1.dev41+ng699b6c3.d20160108-py3.5.egg/khal/khalendar/event.py\", line 136, in fromVEvents\r\n\t\t\t\tinstcls = cls._get_type_from_vDDD(vevents[ref]['DTSTART'])\r\n\t\tKeyError: '1451779200'\r\n\r\nThis happens only occasionally and only on google calendars synced with vdirsyncer.\r\nThe timestamp causing the KeyError represents Jan 3rd at 1 AM. On this date, said google calendar contains an all-day event which recurs daily for about a week, but it seems like it is only the occurence on Jan 3rd causing this problem. In its `.ics` file, the event looks like this:\r\n\r\n    BEGIN:VEVENT\r\n    DTSTART;VALUE=DATE:20160103\r\n    DTEND;VALUE=DATE:20160104\r\n    DTSTAMP:20160108T175109Z\r\n    UID:7[...]@google.com\r\n    RECURRENCE-ID;VALUE=DATE:20160103\r\n    CREATED:20151216T103115Z\r\n    DESCRIPTION:\r\n    LAST-MODIFIED:20160102T142954Z\r\n    LOCATION:\r\n    SEQUENCE:1\r\n    STATUS:CONFIRMED\r\n    SUMMARY: [...]\r\n    TRANSP:TRANSPARENT\r\n    [...]\r\n    END:VEVENT\r\n\r\nIn my sqlite database, where the contents of `vevents` come from, all rows usually seem to have `PROTO` stored in their `ref` column. There is only one single row where this is not the case:\r\n\r\n    sqlite> select * from recs_float where ref is not 'PROTO';\r\n    1451779200|1451865600|dde22800042d40ed9566e83b7f0b70ea.ics|1451779200|1451779200|0|cranio\r\n\r\nI couldn't get into why this event has its `DTSTART` timestamp or whatever in its `ref` row, nor could I find any difference between the event I suspect to be the cause of this and other all-day-events that seem ok.\r\n"},"comment":{"url":"https://api.github.com/repos/geier/khal/issues/comments/170512539","html_url":"https://github.com/geier/khal/issues/323#issuecomment-170512539","issue_url":"https://api.github.com/repos/geier/khal/issues/323","id":170512539,"user":{"login":"geier","id":275330,"avatar_url":"https://avatars.githubusercontent.com/u/275330?v=3","gravatar_id":"","url":"https://api.github.com/users/geier","html_url":"https://github.com/geier","followers_url":"https://api.github.com/users/geier/followers","following_url":"https://api.github.com/users/geier/following{/other_user}","gists_url":"https://api.github.com/users/geier/gists{/gist_id}","starred_url":"https://api.github.com/users/geier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geier/subscriptions","organizations_url":"https://api.github.com/users/geier/orgs","repos_url":"https://api.github.com/users/geier/repos","events_url":"https://api.github.com/users/geier/events{/privacy}","received_events_url":"https://api.github.com/users/geier/received_events","type":"User","site_admin":false},"created_at":"2016-01-11T11:22:49Z","updated_at":"2016-01-11T11:22:49Z","body":"also: are there no additional VEVENTS in that file with the same UID?\r\n"}}