Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 721132 - packages.gentoo.org atom feeds use an invalid time zone +0000 UTC in updated fields
Summary: packages.gentoo.org atom feeds use an invalid time zone +0000 UTC in updated ...
Status: RESOLVED FIXED
Alias: None
Product: Websites
Classification: Unclassified
Component: Packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Packages Website
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-05-05 18:51 UTC by Chris Mayo
Modified: 2020-09-09 13:15 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Mayo 2020-05-05 18:51:10 UTC
Should be either "+0000" or "UTC" not both.


Using Python dateutil:

>>> from dateutil.parser import parse
>>> parse("2020-05-05 08:46:34 +0000 UTC")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.7/site-packages/dateutil/parser/_parser.py", line 1374, in parse
    return DEFAULTPARSER.parse(timestr, **kwargs)
  File "/usr/lib/python3.7/site-packages/dateutil/parser/_parser.py", line 649, in parse
    raise ParserError("Unknown string format: %s", timestr)
dateutil.parser._parser.ParserError: Unknown string format: 2020-05-05 08:46:34 +0000 UTC


>>> parse("2020-05-05 08:46:34 +0000")
datetime.datetime(2020, 5, 5, 8, 46, 34, tzinfo=tzutc())
>>> parse("2020-05-05 08:46:34 UTC")
datetime.datetime(2020, 5, 5, 8, 46, 34, tzinfo=tzutc())
Comment 1 Mike Gilbert gentoo-dev 2020-05-05 18:57:23 UTC
Which feed URL are you looking at?
Comment 2 Chris Mayo 2020-05-05 19:07:32 UTC
First seen with:
https://packages.gentoo.org/packages/added.atom

Updated also:
https://packages.gentoo.org/packages/updated.atom
Comment 3 Mike Gilbert gentoo-dev 2020-05-05 19:21:31 UTC
Here's the relevant part from the Atom spec.

https://tools.ietf.org/html/rfc4287#section-3.3
Comment 4 Alec Warner (RETIRED) archtester gentoo-dev Security 2020-05-05 19:36:53 UTC
(In reply to Mike Gilbert from comment #3)
> Here's the relevant part from the Atom spec.
> 
> https://tools.ietf.org/html/rfc4287#section-3.3

It seems here that time.Now() in golang has non-RFC3339 string construction and so when we render time.time objects in the feeds they get the default render that is not RFC3339 compliant.

https://play.golang.org/p/RWL2BKn9anw

So we need to change how we render dates in the feed templates.

-A
Comment 5 Max Magorsch (RETIRED) Gentoo Infrastructure gentoo-dev 2020-09-09 13:15:11 UTC
This has been fixed some time ago. Thus I'm going to close this bug.

Thanks again for pointing this out.