Skip to content

ical2txt.py doesn't work without start and end time #9

@mkoegel

Description

@mkoegel

Hi,
thanks for writing this tool.

I get the following error:

python3 ical2txt.py export.ics    
Extracting events from file: export.ics 

Traceback (most recent call last):
  File "ical2txt.py", line 156, in <module>
    txt_write(filename)
  File "ical2txt.py", line 96, in txt_write
    if sys.argv[2] != '':
IndexError: list index out of range

It works when I use start and end dates:
python3 ical2txt.py export.ics 2021-05-01 2021-05-31

Would also be nice to mention this option in the readme.

Quickfix:

    if len(sys.argv) > 3:
        if sys.argv[2] != '':
            istart=parse(sys.argv[2]).timestamp()
        if sys.argv[3] != '':
            istop=parse(sys.argv[3]).timestamp()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions