Julian Foad wrote on Tue, 29 Oct 2019 20:54 +00:00:
> Daniel Shahaf wrote:
> > release_date = time.strptime(args.news_release_date, "YYYY-mm-dd") if args.news_release_date else datetime.date.today()
> > … { 'date': release_date.strftime("YYYYmmdd"),
> > 'date_pres': release_date.strftime(…) }
>
> Sounds good. Format strings would be %Y-%m-%d etc.
>
> At a quick try I couldn't get either "time.strptime" nor
> "datetime.strptime" to work. The latter says "AttributeError: 'module'
> object has no attribute 'strptime'"... which puzzles me as the docs say
> it's been available since Python 2.5. I didn't bother to pursue doing
> it using the "time" module though there was nothing stopping me.
>
> Please just do whatever fixes it if you like, else maybe I'll have
> another go later but not urgently.
Thanks, r1869134. The AttributeError was likely because the function's
fully-qualified name is "datetime.datetime.strptime".
I've also committed my "Link to the KEYS file" patch too. (I haven't
done that until now because the soak was in progress.) If either of
these patches gets the way of a 1.13.1 or 1.12.3, don't hesitate to just
revert it to unblock release work.
Cheers,
Daniel
Received on 2019-10-30 00:51:00 CET