caleb531 / open-conference-url

An Alfred workflow to open the Zoom/Meet/etc. URL for your next meeting
MIT License
46 stars 6 forks source link

Workflow crashes with ValueError: unconverted data remains #7

Closed jchase closed 2 years ago

jchase commented 2 years ago

I had an issue where this workflow was crashing with the debugger returning:

...
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/_strptime.py", line 335, in _strptime
    data_string[found.end():])
ValueError: unconverted data remains:
    notes: Garbage

It took me a while to figure out that "notes: Garbage" was actually an item on my calendar (it's a public works calendar I'm subscribed to for our town and "Garbage" / "Recycling" are the items it generates).

Apparently, the name of the event (Garbage) is also in the notes field as well (Garbage) and so on line 39 of event.py, it tries to match the date of a string that looks like this:

2022-02-08 at 07:00
    notes: Garbage

What worked for me was changing (on lines 39 & 45 of event.py - although haven't tested 45 for all day events)

start_datetime_matches.group(1).strip(),

to:

start_datetime_matches.group(1).split('\n', 1)[0].strip(),

Which checks for any newlines (and content that comes after it), lop it off, and only work on the first line. Not sure if there's a better way to do it but it's working great now.

caleb531 commented 2 years ago

@jchase Woah, good catch, and thank you for the detailed report! I have fixed this on a separate branch and will release this next week (once I've tested it against my own calendar data). 🙂

caleb531 commented 2 years ago

@jchase Testing has gone well, so I have just released v3.0.1 with your proposed fix! Please install it below, and let me know if you run into any further issues: https://github.com/caleb531/open-conference-url/releases/tag/v3.0.1