pimutils / khal

:calendar: CLI calendar application
https://lostpackets.de/khal/
MIT License
2.59k stars 200 forks source link

Importing ICS on Fedora 24 Linux #506

Closed gusennan closed 7 years ago

gusennan commented 8 years ago

I tried to issue the command:

khal import ical.ics.zip

And the program failed with the following stacktrace:

[nate@localhost ~]$ khal import ~/Downloads/ical.ics 
Traceback (most recent call last):
  File "/usr/lib/python3.5/site-packages/icalendar/parser.py", line 322, in parts
    validate_token(name)
  File "/usr/lib/python3.5/site-packages/icalendar/parser.py", line 116, in validate_token
    raise ValueError(name)
ValueError: Please install the iCalcreator library to enable iCal output.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/khal", line 9, in <module>
    load_entry_point('khal==0.8.2', 'console_scripts', 'khal')()
  File "/usr/lib/python3.5/site-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python3.5/site-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python3.5/site-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib/python3.5/site-packages/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python3.5/site-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/usr/lib/python3.5/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/usr/lib/python3.5/site-packages/khal/cli.py", line 376, in import_ics
    random_uid=random_uid
  File "/usr/lib/python3.5/site-packages/khal/controllers.py", line 229, in import_ics
    cal = icalendar.Calendar.from_ical(ics)
  File "/usr/lib/python3.5/site-packages/icalendar/cal.py", line 311, in from_ical
    name, params, vals = line.parts()
  File "/usr/lib/python3.5/site-packages/icalendar/parser.py", line 336, in parts
    % (self, exc)
ValueError: Content line could not be parsed into parts: 'Please install the iCalcreator library to enable iCal output.': Please install the iCalcreator library to enable iCal output.

ical.ics.zip

geier commented 8 years ago

This looks really strange, especially as there is no mention of iCalcreator in icalendar's source... Can you see what version of icalendar you have installed? (pip show icalendar)

gusennan commented 7 years ago

'pip show icalendar' returns nothing, which probably means I don't have it installed. Maybe document it or add it as a dependency of ikhal?

untitaker commented 7 years ago

Khal is already dependent on icalendar. BTW it should be pip3 show icalendar.

gusennan commented 7 years ago

Got it. Here's the output.

Metadata-Version: 1.1 Name: icalendar Version: 3.9.0 Summary: iCalendar parser/generator Home-page: https://github.com/collective/icalendar Author: Plone Foundation Author-email: plone-developers@lists.sourceforge.net License: BSD Location: /usr/lib/python3.5/site-packages Requires: python-dateutil, pytz, setuptools

untitaker commented 7 years ago

Oh, I get it! "Please install the iCalcreator library to enable iCal output." is literally in the file you're trying to import! This instruction is not for your local computer, but for the admin of the server you downloaded this iCalendar file from. I suspect this because iCalcreator is the name of a PHP library.

geier commented 7 years ago

@untitaker nice find!

geier commented 7 years ago

can this be closed?

gusennan commented 7 years ago

yes