-
Notifications
You must be signed in to change notification settings - Fork 323
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
timestamp_format raises an exception #1249
Conversation
It is allowed to change the timestamp format in nbgrader_config.py. But e.g. c.Exchange.timestamp_format = "%Y-%m-%d-%H-%M-%S-%f" will raise a ValueError('Unknown string format:', '2019-10-24-20-25-53-460007') in dateutil.parser.parse during collect of submissions. This is due to the new dependency of dateutil.parser.parse in parse_utc(). To avoid this during collection of submission, the above code will check the timestamp_format against dateutils parsing algorithm and raises an configuration error.
It is allowed to change the timestamp format in nbgrader_config.py. But e.g. c.Exchange.timestamp_format = "%Y-%m-%d-%H-%M-%S-%f" will raise a ValueError('Unknown string format:', '2019-10-24-20-25-53-460007') in dateutil.parser.parse during collect of submissions. This is due to the new dependency of dateutil.parser.parse in parse_utc(). To avoid this during collection of submission, the above code will check the timestamp_format against dateutils parsing algorithm and raises an configuration error.
…rse " This reverts commit fcbe0d3.
…rse" This reverts commit 1bbf2fe.
ValueError('Unknown string format:', '2019-10-24-20-25-53-460007') in dateutil.parser.parse during collect of submissions. This is due to the dependency of dateutil.parser.parse in parse_utc(). To avoid this during collection of submission, this code will validate the timestamp_format against dateutils parsing algorithm and raises a TraitError if a ValueError occurs.
PR #1245 has to be merged prior to the CI-checks to avoid the build fails in AppVeyor and Travis CI above |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot! If you could just do a rebase (and make the one change I suggested) I think this is good to merge.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the changes! Looks like the tests are failing though, I think because the import from dateutil isn't quite right.
Yes, obviously a typical typo ! Excuse my laxness ! Co-Authored-By: Jessica B. Hamrick <jessica.b.hamrick@gmail.com>
Hi Jessica, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I'm not too worried about the failing patch changes; I'll go ahead and merge it as is :)
@meeseeksdev backport to 0.6.x |
…9-on-0.6.x Backport PR #1249 on branch 0.6.x (timestamp_format raises an exception)
timestamp_format e.g. "%Y-%m-%d-%H-%M-%S-%f" raises an exception ValueError('Unknown string format:', '2019-10-24-20-25-53-460007') in dateutil.parser.parse during collect of submissions. This is due to the dependency of dateutil.parser.parse in parse_utc(). To avoid this during collection of submission, this PR will validate the timestamp_format against dateutils parsing algorithm and raises a TraitError if a ValueError in dateutil.parser.parse occurs.