prometheus42 / libreoffice-ical-importer

Simple extension for LibreOffice for importing iCalendar files (.ics) into LibreOffice Calc.
MIT License
4 stars 3 forks source link

Import fails if iCalendar file name has spaces #7

Closed RayCulp closed 16 hours ago

RayCulp commented 4 weeks ago

Description:

If the name of the *.ics file to be imported contains spaces, the import fails silently. The column headers are written to the Calc file, but no events.

image

Steps to reproduce

  1. Export an *.ics file from a calendar application without spaces in the file name
  2. Confirm that this *.ics file can be correctly imported into a Calc file using iCalendar Importer extension.
  3. Rename the *.ics file to include spaces in file name.
  4. Attempt to import the file name with spaces.

Expected Result:

iCalendar Importer extension should import the *.ics file into Calc.

Actual Result:

Import fails silently. Column headers are written to Calc file, but no events are imported.

Error Message:

None

Operating System

OS: Ubuntu 22.04 LTS

Software

Program: LibreOffice Version: 24.2

Additional Information

None

RayCulp commented 4 weeks ago

The error is occurring here because the LibreOffice file picker dialog escapes spaces with %20, but the Python open command appears to be interpreting %20 literally.

image

RayCulp commented 4 weeks ago

I can confirm that this can be fixed by adding .replace('%20', ' ') at the end of this statement.

image

prometheus42 commented 16 hours ago

Fixed with 1688dfef2d2cfbaf85dfe19c5b68ddc523f778c6.