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

Extra text allowed after matching time with from_format() #371

Closed
altendky opened this issue May 13, 2019 · 0 comments · Fixed by #372
Closed

Extra text allowed after matching time with from_format() #371

altendky opened this issue May 13, 2019 · 0 comments · Fixed by #372

Comments

@altendky
Copy link
Contributor

re.match() doesn't anchor to the end of the string thus allowing extra text without an error.

if not re.match(pattern, time):
raise ValueError("String does not match format {}".format(fmt))

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 a pull request may close this issue.

1 participant