Bug#980566: Crashes with python traceback if parsing ubuntu.csv

Steve McIntyre steve at einval.com
Thu May 5 23:11:44 BST 2022


Hi Mark,

On Thu, May 05, 2022 at 09:10:23PM +0100, Mark Hindley wrote:
>Just a small update. I think the following is better.
>
>Mark
>
>diff --git a/lsb_release.py b/lsb_release.py
>index 3e19519..472d96b 100644
>--- a/lsb_release.py
>+++ b/lsb_release.py
>@@ -45,7 +45,7 @@ def get_distro_info(origin='Debian'):
>     global RELEASE_CODENAME_LOOKUP, RELEASES_ORDER, TESTING_CODENAME
>     RELEASE_CODENAME_LOOKUP = { r['version']: r['series'] for r in reader if r['version']}
>     RELEASES_ORDER = list(RELEASE_CODENAME_LOOKUP.items())
>-    RELEASES_ORDER.sort(key=lambda n: [int(v) for v in re.split('([[:space:].])+', n[0]) if v.isdigit()])
>+    RELEASES_ORDER.sort(key=lambda n: [int(v) for v in re.split('\D+', n[0]) if v.isdigit()])
>     RELEASES_ORDER = list(list(zip(*RELEASES_ORDER))[1])
> 
>     if origin.lower() == 'debian':

Both of these DTRT for me, I think. Up to you which you prefer... :-)

Thanks!

-- 
Steve McIntyre, Cambridge, UK.                                steve at einval.com
Who needs computer imagery when you've got Brian Blessed?



More information about the Debian-init-diversity mailing list