Skip to content

[3.10] bpo-45386: Handle strftime's ValueError graciously in xmlrpc.client (GH-28765) #28934

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

Merged
merged 1 commit into from
Oct 13, 2021

Conversation

miss-islington
Copy link
Contributor

@miss-islington miss-islington commented Oct 13, 2021

At import time, the xmlrpc.client module uses different date formats to
test strftime so it can format years with 4 digits consistently.
Depending on the underlying C library and its strftime implementation
some of these calls can result in ValueErrors, blocking the
xmlrpc.client module from being imported.

This commit changes the behavior of this bit of code to react to
ValueError exceptions, treating the format that caused them as an
non-viable option.
(cherry picked from commit 1c83135)

Co-authored-by: rtobar [email protected]

https://bugs.python.org/issue45386

…ythonGH-28765)

At import time, the xmlrpc.client module uses different date formats to
test strftime so it can format years with 4 digits consistently.
Depending on the underlying C library and its strftime implementation
some of these calls can result in ValueErrors, blocking the
xmlrpc.client module from being imported.

This commit changes the behavior of this bit of code to react to
ValueError exceptions, treating the format that caused them as an
non-viable option.
(cherry picked from commit 1c83135)

Co-authored-by: rtobar <[email protected]>
@miss-islington
Copy link
Contributor Author

@rtobar and @ambv: Status check is done, and it's a success ✅ .

@ambv ambv merged commit f40b230 into python:3.10 Oct 13, 2021
@miss-islington miss-islington deleted the backport-1c83135-3.10 branch October 13, 2021 17:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants