Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Metro timestamps don't always conform to expected format #310

Closed
hancush opened this issue Feb 17, 2020 · 0 comments · Fixed by opencivicdata/python-legistar-scraper#101
Closed

Comments

@hancush
Copy link
Collaborator

hancush commented Feb 17, 2020

Over the weekend, we saw a few instances of event scrape failure due to a differently formatted timestamp.

ValueError: time data '13:00' does not match format '%I:%M %p'
  File "bin/pupa", line 8, in <module>
    sys.exit(main())
  File "pupa/cli/__main__.py", line 68, in main
    subcommands[args.subcommand].handle(args, other)
  File "pupa/cli/commands/update.py", line 260, in handle
    return self.do_handle(args, other, juris)
  File "pupa/cli/commands/update.py", line 305, in do_handle
    report['scrape'] = self.do_scrape(juris, args, scrapers)
  File "pupa/cli/commands/update.py", line 173, in do_scrape
    report[scraper_name] = scraper.do_scrape(**scrape_args)
  File "pupa/scrape/base.py", line 111, in do_scrape
    for obj in self.scrape(**kwargs) or []:
  File "lametro/events.py", line 195, in scrape
    for event, web_event in self._merge_events(events):
  File "lametro/events.py", line 128, 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))

We should handle this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

1 participant