[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#719063: lsb-release: should support python3



Le mardi 14 juillet 2015, 11:07:57 Didier 'OdyX' Raboud a écrit :
> Control: tag -1 +moreinfo
> 
> Le lundi, 1 juin 2015, 12.00:21 Alexandre Detiste a écrit :
> > Here is a patch that has got some review from "Python3 porting devel" team.

Hi, this port should be really straightforward; because this package
has already been built as a Python3 package for years in Ubuntu.

(see 2to3 & sed magic in override_dh_install)
http://bazaar.launchpad.net/~ubuntu-branches/ubuntu/wily/lsb/wily/view/head:/debian/rules

> Great, thanks. I'll make sure to include it in the next upload. That said, I 
> just tested it, and I get the following error when launching 
> /usr/bin/lsb_release:

Can you provide me the output of "apt-cache policy" ?

This change would likely fix it, but then the test suite complains.

I think the current behaviour where random strings
got compared against index number doesn't make sense anyway.

Can you test it ?

--- a/lsb_release.py
+++ b/lsb_release.py
@@ -185,13 +185,13 @@ def parse_policy_line(data):
 def release_index(x):
     suite = x[1].get('suite')
     if suite:
         if suite in RELEASES_ORDER:
             return int(len(RELEASES_ORDER) - RELEASES_ORDER.index(suite))
         else:
-            return suite
+            try:
+                return float(suite)
+            except ValueError:
+                return 0
     return 0


Cheers,

Alexandre Detiste

Attachment: signature.asc
Description: This is a digitally signed message part.


Reply to: