Repository navigation
fix(rrule): clearer rrulestr error for datetimes written with colons - #1634
Open
Enesuygurs wants to merge 2 commits into
Open
Enesuygurs wants to merge 2 commits into
Enesuygurs wants to merge 2 commits into
Conversation
rrulestr("FREQ=YEARLY;UNTIL=2019-03-29T00:59:59") split the line on the
colon inside the UNTIL value and reported "unsupported property:
FREQ=YEARLY". When the part before the first colon is not a valid
property name, raise an error that shows the whole line and explains
that RFC 5545 datetimes must not contain delimiters. Valid but
unsupported property names keep the existing message.
Fixes dateutil#960
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of changes
rrulestr("FREQ=YEARLY;WKST=MO;UNTIL=2019-03-29T00:59:59+01:00")raisesValueError: unsupported property: FREQ=YEARLY, which points at the wrong thing. Because the string contains a colon,_parse_rfcsplits the line on the colon inside the UNTIL time and treatsFREQ=YEARLYas a property name.When the text before the first colon is not a valid RFC 5545 property name (
[A-Z0-9-]+), the error now shows the whole line and explains that datetimes must be written without delimiters (e.g.20190329T005959). Valid but unsupported names such asX-ABC-MMSUBJkeep the existingunsupported property: X-ABC-MMSUBJmessage.The message and tests are the ones @pganssle suggested in the review of #1069, which was closed without being merged.
Fixes #960
Pull Request Checklist