opencivicdata / scrapers-us-municipal

Scrapers for US municipal governments.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

LAMetro: ValueError: time data '12:00' does not match format '%I:%M %p'

sentry-io opened this issue · comments

Sentry Issue: SCRAPERS-US-MUNICIPAL-139

ValueError: time data '12:00' does not match format '%I:%M %p'
(6 additional frame(s) were not displayed)
...
  File "lametro/events.py", line 184, in scrape
    for event, web_event in self._merge_events(events):
  File "lametro/events.py", line 124, in _merge_events
    for event, web_event in events:
  File "legistar/events.py", line 206, in events
    start_time = time.strptime(time_str, '%I:%M %p')
  File "python3.5/_strptime.py", line 504, in _strptime_time
    tt = _strptime(data_string, format)[0]
  File "python3.5/_strptime.py", line 343, in _strptime
    (data_string, format))

ValueError: time data '12:00' does not match format '%I:%M %p'

The problem is that this cancelled event, does not have an AM or PM. In this particular case, we can probably accurately guess that the meeting was at noon not midnight, but generally we shouldn't guess.

I think the right move here is to ask LA Metro to fix upstream. Thoughts @hancush ?

sounds reasonable to me, @fgregg. can you take this on?

I don't typically communicate with LA Metro, but I can if you'd like.

this was handled upstream by LA Metro