-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
Deprecate isdst argument in email.utils.localtime #72346
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
Comments
With the implementation of PEP-495, email.utils.localtime() does not need the isdst argument to disambiguate naive time. In fact the utility method itself is redundant given that astimezone() now works for naive instances. |
Hi Alexander, Is the idea here to raise deprecation warning starting in 3.6 and remove it by 3.8? Thanks :) |
At this point I think the deprecation warning will go into 3.7, but we should be able to remove it in 3.8. I think I'll probably keep the 'localtime' method and have it delegate it to astimezone, because frankly I would never be able to remember that that was the datetime method I needed to get localtime. |
Thanks David :) The intention is still just to deprecate isdst argument, right? not the localtime(). I can add a sentence in the docs indicating that we favor datetime.astimezone() instead of email.utils.localtime(), if that works for you. What do you think about this? |
No, localtime does something subtly different, in that it will accept a naive datetime add the local timezone to it. Calling localtime() is also more convenient/readable than calling datetime.now().astimezone(). |
Keeping localtime as a convenience function in email.util is fine, but isdst argument should be eliminated at some point. There is a fundamental problem with disambiguating fold times with isdst: some folds do not involve the change in dst or happen in the regions that do not have a dst regime at all. PEP-495 covers this in all the gory details. |
Hi, I'd like to work on this issue. Based on the discussion, the main thing to do here is to raise a deprecation warning when isdst is used? |
@aw1231 Thank you for sticking with the review process for a year to get this old issue to completion. Next time, please do not put |
Thanks to you both! I forgot about this! I'll be sure to format the branch properly next time. Thanks again! |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: