Skip to content

gh-86165: Fix Time2Internaldate with datetime timetuple#151844

Open
yuanx749 wants to merge 3 commits into
python:mainfrom
yuanx749:imaplib
Open

gh-86165: Fix Time2Internaldate with datetime timetuple#151844
yuanx749 wants to merge 3 commits into
python:mainfrom
yuanx749:imaplib

Conversation

@yuanx749

Copy link
Copy Markdown
Contributor

Fixes gh-86165.

The issue explains the cause clearly: datetime.datetime.timetuple() returns a time.struct_time with tm_gmtoff present but set to None, so the AttributeError fallback is skipped.

This change falls back to the local timezone offset when tm_gmtoff is None.

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.

imaplib Time2Internaldate crashing with time.struct_time supplied from datetime.timetuple()

1 participant