Bug#473793: python-debian: add support for parsing removals.txt

Jakub Wilk jwilk at debian.org
Tue Jun 14 14:34:19 UTC 2016


* Stuart Prescott <stuart at debian.org>, 2016-06-15, 00:02:
>+    @property
>+    def date(self):
>+        """ a datetime object for the removal action """
>+        try:
>+            from dateutil.parser import parse
>+        except ImportError:
>+            warnings.warn("Install the python-dateutil or python3-dateutil "
>+                    "package to process dates in package removals.")
>+            raise
>+        return parse(self['date'])

There's a RFC 822 date parser in Python stdlib 
(email.utils.parsedate_tz), so if we jumped through a hops or two, we 
could avoid this extra dependency.

Hmm, I wonder how other parts of python-debian parse dates...

>+            self.assertEqual(r.bug, ['753912'])
>+            self.assertEqual(r.also_wnpp, ['123456'])

Shouldn't bug numbers be integers?

-- 
Jakub Wilk



More information about the pkg-python-debian-maint mailing list