GeezerVison is showing github.com — Deprecate isdst argument in email.utils.localtime · Issue #72346 · python/cpython
Deprecate isdst argument in email.utils.localtime #72346Description
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:
assignee = None
closed_at = None
created_at = <Date 2016-09-14.21:55:13.766>
labels = ['easy', 'library', '3.11']
title = 'Deprecate isdst argument in email.utils.localtime'
updated_at = <Date 2022-02-08.16:46:38.005>
user = 'https://github.com/abalkin'
bugs.python.org fields:
activity = <Date 2022-02-08.16:46:38.005>
actor = 'Alan.Williams'
assignee = 'none'
closed = False
closed_date = None
closer = None
components = ['Library (Lib)']
creation = <Date 2016-09-14.21:55:13.766>
creator = 'belopolsky'
dependencies = []
files = []
hgrepos = []
issue_num = 28159
keywords = ['easy']
message_count = 7.0
messages = ['276492', '281078', '281125', '281127', '281139', '281161', '412846']
nosy_count = 4.0
nosy_names = ['belopolsky', 'r.david.murray', 'Alan.Williams', 'Mariatta']
pr_nums = []
priority = 'normal'
resolution = None
stage = None
status = 'open'
superseder = None
type = None
url = 'https://bugs.python.org/issue28159'
versions = ['Python 3.11']
Activityabalkin commented on Sep 14, 2016 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. Mariatta commented on Nov 18, 2016 Hi Alexander,
Is the idea here to raise deprecation warning starting in 3.6 and remove it by 3.8?
Thanks :) bitdancer commented on Nov 18, 2016 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. Mariatta commented on Nov 18, 2016 Thanks David :)
So, I found that isdst was never added as method signature in the docs, but it is mentioned in the paragraph.
https://docs.python.org/3.7/library/email.util.html?#email.utils.localtime
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? bitdancer commented on Nov 18, 2016 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(). abalkin commented on Nov 18, 2016 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. aw1231 commented on Feb 8, 2022 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? added a commit that references this issue on Mar 20, 2023gh-72346: Added isdst deprecation warning to email.utils.localtime (G… terryjreedy commented on Mar 20, 2023 @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 gh-###### in the branch title as it triggers an unneeded duplicate report of every commit here on the issue. I believe anything else without gh- or a literal # prefix would not do this. alanfwilliams commented on Mar 20, 2023 Thanks to you both! I forgot about this! I'll be sure to format the branch properly next time. Thanks again!
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|