insanum / gcalcli

Google Calendar Command Line Interface
MIT License
3.3k stars 311 forks source link

import ics: month must be in 1..12 #114

Open ghost opened 10 years ago

ghost commented 10 years ago

Not sure if this is a problem with gcalcli or my ics file (it works with google calendar online, and with orage)... Installed through debian wheezy, version 2.1-2 of gcalcli.

I run: /usr/bin/gcalcli --config ~/.config/gcalclirc import pfl.ics

I get errors: Traceback (most recent call last): File "/usr/bin/gcalcli", line 1524, in BowChickaWowWow() File "/usr/bin/gcalcli", line 1514, in BowChickaWowWow gcal.ImportICS(args[1]) File "/usr/bin/gcalcli", line 1091, in ImportICS v = vobject.readComponents(f).next() File "/usr/lib/pymodules/python2.7/vobject/base.py", line 1059, in readComponents if transform: component.transformChildrenToNative() File "/usr/lib/pymodules/python2.7/vobject/base.py", line 602, in transformChildrenToNative childArray[i].transformChildrenToNative() File "/usr/lib/pymodules/python2.7/vobject/base.py", line 601, in transformChildrenToNative childArray[i]=childArray[i].transformToNative() File "/usr/lib/pymodules/python2.7/vobject/base.py", line 122, in transformToNative return self.behavior.transformToNative(self) File "/usr/lib/pymodules/python2.7/vobject/icalendar.py", line 709, in transformToNative obj.value=parseDtstart(obj, allowSignatureMismatch=True) File "/usr/lib/pymodules/python2.7/vobject/icalendar.py", line 1833, in parseDtstart return stringToDate(contentline.value) File "/usr/lib/pymodules/python2.7/vobject/icalendar.py", line 1604, in stringToDate return datetime.date(year,month,day) vobject.base.ParseError: At line 13: In transformToNative, unhandled exception: <type 'exceptions.ValueError'>: month must be in 1..12

~/.config/gcalclirc [gcalcli] user: xxx pw:xxx

The following lines are optional

24hr: true details: true ignore-started: true mon: true

pfl.ics: BEGIN:VCALENDAR VERSION:2.0 PRODID:-//hacksw/handcal//NONSGML v1.0//EN CALSCALE:GREGORIAN BEGIN:VEVENT DTSTAMP: 20131102T113043Z DTSTART: 20131103T160000 DTEND: 20131103T165000 UID: 5274d453e5496 SUMMARY: TEST END:VEVENT END:VCALENDAR

tresni commented 10 years ago

This actually looks to be an issue with vobject. I'm not sure why it's barfing on that ics as it looks fine to me. I'll see if I can isolate and send something to the vobject guys.

jcrowgey commented 6 years ago

Since this is reported against 2.1-2 I thought it was worth it to check if it's still around:

On 3.4:

Traceback (most recent call last): File "/usr/bin/gcalcli", line 2649, in BowChickaWowWow() File "/usr/bin/gcalcli", line 2636, in BowChickaWowWow gcal.ImportICS(FLAGS.verbose, FLAGS.dump, FLAGS.reminder, args[1]) File "/usr/bin/gcalcli", line 2102, in ImportICS v = vobject.readComponents(f).next() File "/usr/lib/python2.7/dist-packages/vobject/base.py", line 1108, in readComponents raise ParseError(err % stack.topName(), n) vobject.base.ParseError: At line 12: VCALENDAR component wasn't closed

On 4.0

Traceback (most recent call last): File "/home/jcrowgey/src/gcalcli/venv27/bin/gcalcli", line 11, in sys.exit(main()) File "/home/jcrowgey/src/gcalcli/venv27/local/lib/python2.7/site-packages/gcalcli/gcalcli.py", line 1694, in main FLAGS.verbose, FLAGS.dump, FLAGS.reminders, FLAGS.file) File "/home/jcrowgey/src/gcalcli/venv27/local/lib/python2.7/site-packages/gcalcli/gcalcli.py", line 1491, in ImportICS v = next(vobject.readComponents(f)) File "/home/jcrowgey/src/gcalcli/venv27/local/lib/python2.7/site-packages/vobject/base.py", line 1134, in readComponents raise ParseError(err.format(stack.topName()), n) vobject.base.ParseError: At line 12: VCALENDAR component wasn't closed

As @trensi says, these are actually messages from the vobject module. I don't yet know enough about this format to say if the error is a bug upstream or if this is actually an invalid VCARD. Also, fwiw, I haven't yet tried on python3. Was this ever filed upstream against vobject?