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

Avoid crashing upon invalid timestamps #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nemobis
Copy link
Contributor

@nemobis nemobis commented Apr 22, 2014

Traceback (most recent call last):
File "rfc_stats.py", line 547, in
for i, vote in enumerate(vote_page.get_votes()):
File "rfc_stats.py", line 303, in get_votes
yield Vote.from_line(self, line, section_label)
File "rfc_stats.py", line 89, in from_line
vote.datetime = cls.parse_datetime(line)
File "rfc_stats.py", line 125, in parse_datetime
return datetime.strptime(m.group(0), config.date_format)
File "/usr/lib64/python2.7/_strptime.py", line 325, in _strptime
(data_string, format))
ValueError: time data '24:14, 2 March 2014 (UTC)' does not match format '%H:%M, %d %B %Y (UTC)'

Traceback (most recent call last):
  File "rfc_stats.py", line 547, in <module>
    for i, vote in enumerate(vote_page.get_votes()):
  File "rfc_stats.py", line 303, in get_votes
    yield Vote.from_line(self, line, section_label)
  File "rfc_stats.py", line 89, in from_line
    vote.datetime = cls.parse_datetime(line)
  File "rfc_stats.py", line 125, in parse_datetime
    return datetime.strptime(m.group(0), config.date_format)
  File "/usr/lib64/python2.7/_strptime.py", line 325, in _strptime
    (data_string, format))
ValueError: time data '24:14, 2 March 2014 (UTC)' does not match format '%H:%M, %d %B %Y (UTC)'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant