This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: imaplib: Internaldate2tuple() is documented to return UTC, but it returns local time
Type: Stage: resolved
Components: Documentation Versions: Python 3.2, Python 2.7
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: docs@python Nosy List: belopolsky, docs@python, lavajoe
Priority: normal Keywords: patch

Created on 2011-01-18 13:46 by lavajoe, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
imaplib_Internaldate2tuple_doc_python32.patch lavajoe, 2011-01-18 13:46
imaplib_Internaldate2tuple_doc_python27.patch lavajoe, 2011-01-18 13:46
issue10934.diff belopolsky, 2011-01-19 19:30
Messages (5)
msg126463 - (view) Author: Joe Peterson (lavajoe) Date: 2011-01-18 13:46
Patched documentation for Internaldate2tuple() to correctly state it returns local time.

Also, Time2Internaldate() (its inverse) did not state that it needs local time as input, so patched this as well.

Patches for 3.2 and 2.7 are attached.
msg126557 - (view) Author: Alexander Belopolsky (belopolsky) * (Python committer) Date: 2011-01-19 19:30
It makes sense that Internaldate2tuple() returns local time because timetuple (with its tm_isdst flag) strongly suggests local time.  (See also issue 9004.)

If UTC or any other timezone time is needed, it would be best to provide a function that would return an aware datetime object.

I made some changes to Joe's patch in attached diff.  I would appreciate another pair of eyes to look at it before I commit.
msg126559 - (view) Author: Joe Peterson (lavajoe) Date: 2011-01-19 19:45
Hey Alexander,

Looks great.  Just a few small things:

* In hunk 2 of the imaplib.rst file patch section, insert word "to" (i.e. "Convert *date_time* to an IMAP4 ``INTERNALDATE`` representation.")

* Two lines, down there's only one space at end of sentence:  "double-quotes). The" (all other places have 2 spaces).

* In first hunk of imaplib.py patch section, there is a period that does not belong after "tuple":  "time.struct_time tuple. or None"

That's all I saw!  Thanks for expanding on the doc!
msg126560 - (view) Author: Alexander Belopolsky (belopolsky) * (Python committer) Date: 2011-01-19 19:54
Committed in revision 88114.
msg126570 - (view) Author: Alexander Belopolsky (belopolsky) * (Python committer) Date: 2011-01-19 21:48
Merged to 2.7 in revision 88116.
History
Date User Action Args
2022-04-11 14:57:11adminsetgithub: 55143
2011-01-19 21:48:54belopolskysetstatus: open -> closed

messages: + msg126570
nosy: belopolsky, docs@python, lavajoe
stage: commit review -> resolved
2011-01-19 19:54:21belopolskysetnosy: belopolsky, docs@python, lavajoe
messages: + msg126560
2011-01-19 19:45:10lavajoesetnosy: belopolsky, docs@python, lavajoe
messages: + msg126559
2011-01-19 19:30:18belopolskysetfiles: + issue10934.diff

nosy: + belopolsky
messages: + msg126557

resolution: accepted
stage: commit review
2011-01-19 17:53:12belopolskylinkissue10921 superseder
2011-01-18 13:46:20lavajoesetfiles: + imaplib_Internaldate2tuple_doc_python27.patch
2011-01-18 13:46:04lavajoecreate