Alexander Belopolsky <belopol...@users.sourceforge.net> added the comment:
There are at least 3 issues here: a documentation issue, a py3k bug and at least one feature request. Given that the logistics are different for different kinds of issues, I think it would be best to split them on the tracker. Here is how I see what is being proposed: 1. Internaldate2tuple is documented to return UTC timetuple, but implemented to return local time (ignoring the DST issues.) The proposal is to change the documentation. 2. There are a couple of str vs bytes bugs that obviously need to be fixed. 3. The proposed patch also make both str and bytes acceptable as Internaldate2tuple argument. As discussed in issue 9864, it would be best if datetime formatting and parsing routines would operate on datetime objects. Something along the lines of def parseinternaldate(datestr): return datetime.strptime(datestr, "%d-%b-%Y %H:%M:%S %z") def formatinternaldate(dateobj): return dateobj.strftime("%d-%b-%Y %H:%M:%S %z") The above uses recently added timezone support in datetime module. There is still a problem, though. The code above would only work as expected in the C locale, but Time2Internaldate already has this limitation. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue10921> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com