Skip to content

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

Merged
ambv merged 1 commit into
python:3.10from
miss-islington:backport-1c83135-3.10
Oct 13, 2021
Merged

[3.10] bpo-45386: Handle strftime's ValueError graciously in xmlrpc.client (GH-28765)#28934
ambv merged 1 commit into
python:3.10from
miss-islington:backport-1c83135-3.10

Conversation

@miss-islington
Copy link
Copy Markdown
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 rtobarc@gmail.com

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 <rtobarc@gmail.com>
@miss-islington
Copy link
Copy Markdown
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