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

gh-115225: Raise error on unsupported ISO 8601 time strings #119339

Merged
merged 5 commits into from
Jun 5, 2024

Conversation

benchatt
Copy link
Contributor

@benchatt benchatt commented May 21, 2024

Some time strings that contain fractional hours or minutes are permitted by ISO 8601, but such strings are very unlikely to be intentional. The current parser does not parse such strings correctly or raise an error. This change raises a ValueError when hours or minutes contain a decimal mark.

@benchatt benchatt requested review from pganssle and abalkin as code owners May 21, 2024 18:44
Copy link

cpython-cla-bot bot commented May 21, 2024

All commit authors signed the Contributor License Agreement.
CLA signed

@bedevere-app
Copy link

bedevere-app bot commented May 21, 2024

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@bedevere-app
Copy link

bedevere-app bot commented May 21, 2024

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@benchatt benchatt marked this pull request as ready for review May 21, 2024 19:04
Copy link
Member

@pganssle pganssle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me, but can you add a test case?

@bedevere-app
Copy link

bedevere-app bot commented May 22, 2024

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@benchatt benchatt force-pushed the fix-issue-115225 branch from 28dc6e7 to 8bc3c11 Compare May 22, 2024 17:37
@benchatt
Copy link
Contributor Author

I have made the requested changes; please review again

@bedevere-app
Copy link

bedevere-app bot commented May 22, 2024

Thanks for making the requested changes!

@pganssle: please review the changes made to this pull request.

@bedevere-app bedevere-app bot requested a review from pganssle May 22, 2024 17:37
Copy link
Member

@pganssle pganssle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One last thing before merge is I realized that this patch doesn't credit you. Do you want to add yourself to the news fragment and the ACKS file?

Those are not required, but it's commonly done and good to give credit where credit is due. 😅

@benchatt
Copy link
Contributor Author

benchatt commented May 24, 2024 via email

benchatt and others added 3 commits May 24, 2024 08:13
Some time strings that contain fractional hours or minutes are permitted
by ISO 8601, but such strings are very unlikely to be intentional. The
current parser does not parse such strings correctly or raise an error.
This change raises a ValueError when hours or minutes contain a decimal mark.
Blurb was pointing at wrong meth name
@benchatt benchatt force-pushed the fix-issue-115225 branch from b160163 to 188a6da Compare May 24, 2024 15:15
@benchatt
Copy link
Contributor Author

One last thing before merge is I realized that this patch doesn't credit you. Do you want to add yourself to the news fragment and the ACKS file?

Those are not required, but it's commonly done and good to give credit where credit is due. 😅

Alright, those are ready! Let me know if anything's out of sync or unusual and I'll fix it. Thanks again!

@benchatt
Copy link
Contributor Author

I have made the requested changes; please review again

@bedevere-app
Copy link

bedevere-app bot commented May 26, 2024

Thanks for making the requested changes!

@pganssle: please review the changes made to this pull request.

@bedevere-app bedevere-app bot requested a review from pganssle May 26, 2024 22:53
@benchatt
Copy link
Contributor Author

@pganssle Not sure I was supposed to call on Bedevere again. Sorry about that!

@benchatt
Copy link
Contributor Author

benchatt commented Jun 1, 2024 via email

@pganssle pganssle merged commit 14e3c70 into python:main Jun 5, 2024
38 of 40 checks passed
barneygale pushed a commit to barneygale/cpython that referenced this pull request Jun 5, 2024
…thon#119339)

Some time strings that contain fractional hours or minutes are permitted
by ISO 8601, but such strings are very unlikely to be intentional. The
current parser does not parse such strings correctly or raise an error.
This change raises a ValueError when hours or minutes contain a decimal mark.

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
noahbkim pushed a commit to hudson-trading/cpython that referenced this pull request Jul 11, 2024
…thon#119339)

Some time strings that contain fractional hours or minutes are permitted
by ISO 8601, but such strings are very unlikely to be intentional. The
current parser does not parse such strings correctly or raise an error.
This change raises a ValueError when hours or minutes contain a decimal mark.

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
estyxx pushed a commit to estyxx/cpython that referenced this pull request Jul 17, 2024
…thon#119339)

Some time strings that contain fractional hours or minutes are permitted
by ISO 8601, but such strings are very unlikely to be intentional. The
current parser does not parse such strings correctly or raise an error.
This change raises a ValueError when hours or minutes contain a decimal mark.

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants