8000 xmlrpc.client uses datetime.datetime.isoformat() by vstinner · Pull Request #105741 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

xmlrpc.client uses datetime.datetime.isoformat() #105741

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 2 commits into from
Jun 14, 2023

Conversation

vstinner
Copy link
Member

Reimplement _iso8601_format() using the datetime isoformat() method.

Reimplement _iso8601_format() using the datetime isoformat() method.
@vstinner
Copy link
Member Author

cc @abalkin @pganssle @AlexWaygood

boolean = Boolean = bool

##
# Wrapper for XML-RPC DateTime values. This converts a time value to
Copy link
Member

Choose a reason for hiding this comment

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

I'm guessing that this comment is outdated, since it seems like _iso8601_format defined below does not accept strings or time tuples...

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, I was surprised by this comment. It looks outdated, _iso8601_format() is now only called with datetime.datetime instances.

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.

LGTM. One nit.

Co-Authored-by: Paul Ganssle <1377457+pganssle@users.noreply.github.com>
@vstinner
Copy link
Member Author

http://xmlrpc.com/spec.md has a cute answer:

What timezone should be assumed for the dateTime.iso8601 type? UTC? localtime?

Don't assume a timezone. It should be specified by the server in its documentation what assumptions it makes about timezones.

@vstinner
Copy link
Member Author

I updated the PR to ignore the time zone. I added a test.

@vstinner vstinner merged commit 307bcea into python:main Jun 14, 2023
@vstinner vstinner deleted the xmlrpc_isoformat branch June 14, 2023 15:00
@vstinner
Copy link
Member Author
vstinner commented Jun 14, 2023

@pganssle: the review was useful, thanks, I completely forgot about the timezone 😮 Did anyone tell you that date and time management is hard? Wow! 😂

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.

3 participants
0