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.

Author belopolsky
Recipients belopolsky, docs@python, georg.brandl, lavajoe, r.david.murray
Date 2011-01-18.03:18:44
SpamBayes Score 3.021694e-12
Marked as misclassified No
Message-id <1295320727.28.0.261389654.issue10921@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2011-01-18 03:18:47belopolskysetrecipients: + belopolsky, georg.brandl, r.david.murray, docs@python, lavajoe
2011-01-18 03:18:47belopolskysetmessageid: <1295320727.28.0.261389654.issue10921@psf.upfronthosting.co.za>
2011-01-18 03:18:44belopolskylinkissue10921 messages
2011-01-18 03:18:44belopolskycreate