X-Loop: [email protected] Subject: bug#468: python platform.linux_distribution() returns debian Reply-To: [email protected], [email protected] Resent-From: Peter Duffy <[email protected]> Resent-To: [email protected] Resent-CC: [email protected] X-Loop: [email protected] Resent-Date: Thu, 21 May 2020 15:48:01 +0000 Resent-Message-ID: <[email protected]> Resent-Sender: [email protected] X-Devuan-PR-Message: report 468 X-Devuan-PR-Package: libpython2.7-minimal X-Devuan-PR-Keywords: Received: via spool by [email protected] id=B.15900756032671 (code B); Thu, 21 May 2020 15:48:01 +0000 Received: (at submit) by bugs.devuan.org; 21 May 2020 15:40:03 +0000 Delivered-To: [email protected] Received: from tupac3.dyne.org [195.169.149.119] by doc.devuan.org with IMAP (fetchmail-6.4.0.beta4) for <debbugs@localhost> (single-drop); Thu, 21 May 2020 15:40:03 +0000 (UTC) Received: from omega.myqiq.info (omega.myqiq.info [72.52.170.129]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by vm6.ganeti.dyne.org (Postfix) with ESMTPS id 5A205F60CBE for <[email protected]>; Thu, 21 May 2020 17:33:39 +0200 (CEST) Authentication-Results: vm6.ganeti.dyne.org; dkim=pass (2048-bit key; unprotected) header.d=pwduffy.org.uk [email protected] header.b="NJRbiZ3l"; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=pwduffy.org.uk; s=default; h=Content-Transfer-Encoding:Mime-Version: Message-ID:Date:Content-Type:To:Reply-To:From:Subject:Sender:Cc:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=E4N8Ir03HzmIbDIXVOGvyRmziSQ+8mVaWBLV3bPI77Q=; b=NJRbiZ3lxCdcnpr+0dyCkzMvQT gJW9KCSoInGPd6WNbLj0AewbjH54NThQMw9ZYBYF99rApGkYt13iAjed1y2hYwx30HS4sAV0AnfR3 4cOQNdnCyFrm0UZKxSAJZYvVzmqjz5+v15qXj/bMKSQl5+2Fl9cHkEarVnBftHC1+4E9yD2Lofpq2 FuuxDBUnvyp5Q2uSt3oSiqd423kkMXlDUr1TuGd4vDQDWkpfXjKBq9rd1EH4ReLiQRutU6KORwepW SuT3vrPk/gF7XrCnND2L0gUQ7/wVFMDDOBzJV4knZRJlpzy2i/225Qy9TS3C1FwAerPBBZfCvULaK SvKC4FpQ==; Received: from cpc118362-brad23-2-0-cust385.17-1.cable.virginm.net ([86.14.225.130]:58938 helo=[192.168.1.86]) by omega.myqiq.info with esmtpa (Exim 4.93) (envelope-from <[email protected]>) id 1jbnCS-00BIUU-LZ for [email protected]; Thu, 21 May 2020 15:33:36 +0000 From: Peter Duffy <[email protected]> To: [email protected] Content-Type: text/plain; charset="UTF-8" Date: Thu, 21 May 2020 16:33:35 +0100 Message-ID: <[email protected]> Mime-Version: 1.0 X-Mailer: Evolution 2.32.3 (2.32.3-34.el6) Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - omega.myqiq.info X-AntiAbuse: Original Domain - bugs.devuan.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - pwduffy.org.uk X-Get-Message-Sender-Via: omega.myqiq.info: authenticated_id: [email protected] X-Authenticated-Sender: omega.myqiq.info: [email protected] X-Source: X-Source-Args: X-Source-Dir: X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,SPF_PASS autolearn=disabled version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tupac3.dyne.org Package: libpython2.7-minimal Version: 2.7.13 Environment in which bug seen: Devuan 2.1 (ascii) Problem behaviour: python function platform.linux_distribution() returns "debian" instead of "devuan" To reproduce: (from command-line): python (from python prompt): import platform platform.linux_distribution() (should return: "('debian','9','')" quit() Test fix: platform.linux_distribution() tries to use the file /etc/lsb-release. This doesn't appear to exist either in Debian stretch or Devuan ascii - unless it's present in a package which isn't included in the default install. Creating it with appropriate values fixes the problem: Check whether /etc/lsb-release exists: it shouldn't, - but if so, rename it (and rename it back after the test). lsb_release -a > /etc/lsb-release Edit /etc/lsb-release and change as follows: "Distributor ID: " => "DISTRIB_ID=" "Description: " => "DISTRIB_DESCRIPTION=" "Release: " => "DISTRIB_RELEASE=" "Codename: " => "DISTRIB_CODENAME=" Above test should now return: "('Devuan','2.1','ascii')" Additional information: The problem is apparently caused by the combination of the absence of /etc/lsb-release, and the presence of /etc/debian_release. The algorithm in platform.linux_distribution() is apparently to try reading /etc/lsb-release, and if it doesn't exist, look for any file matching /etc/*_(version|release) The bug also exists in python3 (package libpython3.5-minimal, version 3.5.3) - to reproduce, repeat the above test using "python3" instead of "python" The bug also exists in beowulf Not sure whether above "fix" is feasible in practice - maybe other python-based packages rely on getting back "debian" from platform.linux_distribution()? This problem came to light because it breaks the waagent package - because it believes that it's running on debian, waagent tries to use systemd-based commands and functions. I'm currently working this problem, but I'm approaching it by putting in place internal tests to ascertain whether debian or devuan, rather than relying on a system-level fix. platform.linux_distribution() is deprecated and slated for removal If it's decided that this can be safely fixed by creating /etc/lsb-release, one question needs answering: whether to lowercase the DISTRIB_ID field, or to leave it as returned by lsb_release
Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 X-Loop: [email protected] From: "Devuan bug Tracking System" <[email protected]> To: [email protected] Subject: bug#468: Acknowledgement (python platform.linux_distribution() returns debian) Message-ID: <[email protected]> References: <[email protected]> X-Devuan-PR-Message: ack 468 X-Devuan-PR-Package: libpython2.7-minimal Reply-To: [email protected] Date: Thu, 21 May 2020 15:48:06 +0000 Thank you for filing a new bug report with Devuan. You can follow progress on this bug here: 468: https://bugs.devuan.org/cgi/= bugreport.cgi?bug=3D468. This is an automatically generated reply to let you know your message has been received. Your message is being forwarded to the package maintainers and other interested parties for their attention; they will reply in due course. Your message has been sent to the package maintainer(s): [email protected] If you wish to submit further information on this problem, please send it to [email protected]. Please do not send mail to [email protected] unless you wish to report a problem with the Bug-tracking system. --=20 468: https://bugs.devuan.org/cgi/bugreport.cgi?bug=3D468 Devuan Bug Tracking System Contact [email protected] with problems
X-Loop: [email protected] Subject: bug#468: python platform.linux_distribution() returns debian Reply-To: Mark Hindley <[email protected]>, [email protected] Resent-From: Mark Hindley <[email protected]> Resent-To: [email protected] Resent-CC: [email protected] X-Loop: [email protected] Resent-Date: Fri, 22 May 2020 10:03:01 +0000 Resent-Message-ID: <[email protected]> Resent-Sender: [email protected] X-Devuan-PR-Message: followup 468 X-Devuan-PR-Package: libpython2.7-minimal X-Devuan-PR-Keywords: References: <[email protected]> <[email protected]> Received: via spool by [email protected] id=B468.159014100518265 (code B ref 468); Fri, 22 May 2020 10:03:01 +0000 Received: (at 468) by bugs.devuan.org; 22 May 2020 09:50:05 +0000 Delivered-To: [email protected] Received: from tupac3.dyne.org [195.169.149.119] by doc.devuan.org with IMAP (fetchmail-6.4.0.beta4) for <debbugs@localhost> (single-drop); Fri, 22 May 2020 09:50:05 +0000 (UTC) Received: from mx.hindley.org.uk (mohindley.plus.com [81.174.245.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by vm6.ganeti.dyne.org (Postfix) with ESMTPS id 357A7F609D9 for <[email protected]>; Fri, 22 May 2020 11:45:07 +0200 (CEST) Received: from apollo.hindleynet ([192.168.1.3] helo=hindley.org.uk) by mx.hindley.org.uk with smtp (Exim 4.84_2) (envelope-from <[email protected]>) id 1jc4Ej-00070Z-O4; Fri, 22 May 2020 10:45:05 +0100 Received: (nullmailer pid 3138 invoked by uid 1000); Fri, 22 May 2020 09:45:05 -0000 Date: Fri, 22 May 2020 10:45:05 +0100 From: Mark Hindley <[email protected]> To: [email protected], [email protected] Message-ID: <[email protected]> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <[email protected]> User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-0.0 required=5.0 tests=SPF_PASS autolearn=disabled version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tupac3.dyne.org Peter, Thanks for this. It is somewhat problematic for a number of reasons: - python2 is EOL. - as you point out, platform.linux_distribution() is deprecated and slated for removal in python3 (presumably for the very reason you have discovered -- it isn't reliable). - In my opinion, applications and functions should use output of lsb_release -a directly (as many already do). - Devuan beowulf deliberately has ID=Debian in lsb_release -a (see the Release Notes[1] for an explanation why). This has been changed to ID=Devuan for ceres/chimaera. - neither python2 nor python3 are forked packages and Devuan uses Debian's packages directly. Considering all that, I find it difficult to see a feasible route to fixing this. Having /etc/lsb_release as another source of information only consulted by some applications seems a retrograde step. Best wishes, Mark [1] https://files.devuan.org/devuan_beowulf/Release_notes.txt
X-Loop: [email protected] Subject: bug#468: python platform.linux_distribution() returns debian Reply-To: Mark Hindley <[email protected]>, [email protected] Resent-From: Mark Hindley <[email protected]> Resent-To: [email protected] Resent-CC: [email protected] X-Loop: [email protected] Resent-Date: Fri, 22 May 2020 12:03:02 +0000 Resent-Message-ID: <[email protected]> Resent-Sender: [email protected] X-Devuan-PR-Message: followup 468 X-Devuan-PR-Package: libpython2.7-minimal X-Devuan-PR-Keywords: References: <[email protected]> <[email protected]> <[email protected]> <[email protected]> Received: via spool by [email protected] id=B468.159014820526610 (code B ref 468); Fri, 22 May 2020 12:03:02 +0000 Received: (at 468) by bugs.devuan.org; 22 May 2020 11:50:05 +0000 Delivered-To: [email protected] Received: from tupac3.dyne.org [195.169.149.119] by doc.devuan.org with IMAP (fetchmail-6.4.0.beta4) for <debbugs@localhost> (single-drop); Fri, 22 May 2020 11:50:04 +0000 (UTC) Received: from mx.hindley.org.uk (mohindley.plus.com [81.174.245.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by vm6.ganeti.dyne.org (Postfix) with ESMTPS id 9B5F1F60CBD for <[email protected]>; Fri, 22 May 2020 13:49:20 +0200 (CEST) Received: from apollo.hindleynet ([192.168.1.3] helo=hindley.org.uk) by mx.hindley.org.uk with smtp (Exim 4.84_2) (envelope-from <[email protected]>) id 1jc6Aw-0007fU-HM; Fri, 22 May 2020 12:49:18 +0100 Received: (nullmailer pid 5439 invoked by uid 1000); Fri, 22 May 2020 11:49:17 -0000 Date: Fri, 22 May 2020 12:49:17 +0100 From: Mark Hindley <[email protected]> To: Peter Duffy <[email protected]> Cc: [email protected] Message-ID: <[email protected]> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <[email protected]> User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-0.0 required=5.0 tests=SPF_PASS autolearn=disabled version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tupac3.dyne.org Peter, On Fri, May 22, 2020 at 12:21:01PM +0100, Peter Duffy wrote: > Hi Mark, > > Thanks for getting back to me. I agree that this is problematic, and I > concur with your points and decision not to fix. I will leave this open, in case any better suggestions come along. > As I mentioned, I came up against this whilst trying to fix waagent (aka > walinuxagent and azurelinuxagent) - the glue layer which the Microsoft > Azure front-end uses to communicate with linux running on VMs. I'm > trying to set up a virtualbox VM based on devuan ascii, for use as a > base OS image in Azure. At the moment, waagent detects the system as > debian instead of devuan, and so tries to use systemd-based utilities > and functions: of course, these aren't present, so waagent doesn't work > under devuan. (I'm not sure that it's worth flagging it up as a bug in > the waagent package? OK, the problem is specific to devuan, but it needs > to be fixed in waagent.) Yes, please do. Let me know if there is anything I can do to help. It is also worth noting that this approach will sometimes be broken in Debian too: non-systemd init is still possible in all Debian suites. I suggest it would be better if they detected init system and acted on that rather than inferred the init from the distribution. > BTW - one point of order. The utility is /usr/bin/lsb_release - the file > that platform.linux_distribution() tries to use is /etc/lsb-release. > Don't ask me why :( Absolutely -- thanks for correcting my lazy typing! Mark
Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 X-Loop: [email protected] From: "Devuan bug Tracking System" <[email protected]> To: Mark Hindley <[email protected]> Subject: bug#468: Info received (bug#468: python platform.linux_distribution() returns debian) Message-ID: <[email protected]> References: <[email protected]> X-Devuan-PR-Message: ack-info 468 X-Devuan-PR-Package: libpython2.7-minimal Reply-To: [email protected] Date: Fri, 22 May 2020 12:03:04 +0000 Thank you for the additional information you have supplied regarding this bug report. This is an automatically generated reply to let you know your message has been received. Your message is being forwarded to the package maintainers and other interested parties for their attention; they will reply in due course. Your message has been sent to the package maintainer(s): [email protected] If you wish to submit further information on this problem, please send it to [email protected]. Please do not send mail to [email protected] unless you wish to report a problem with the Bug-tracking system. --=20 468: https://bugs.devuan.org/cgi/bugreport.cgi?bug=3D468 Devuan Bug Tracking System Contact [email protected] with problems
MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) X-Loop: [email protected] From: "Devuan bug Tracking System" <[email protected]> To: Mark Hindley <[email protected]> Subject: bug#468: marked as done (python platform.linux_distribution() returns debian) Message-ID: <[email protected]> References: <[email protected]> <[email protected]> X-Devuan-PR-Message: closed 468 X-Devuan-PR-Package: libpython2.7-minimal Reply-To: [email protected] Date: Tue, 24 Jan 2023 17:20:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1674580802-15641-0" This is a multi-part message in MIME format... ------------=_1674580802-15641-0 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your message dated Tue, 24 Jan 2023 17:17:49 +0000 with message-id <[email protected]> and subject line Re: bug#468: python platform.linux_distribution() returns = debian has caused the Devuan bug report #468, regarding python platform.linux_distribution() returns debian to be marked as done. This means that you claim that the problem has been dealt with. If this is not the case it is now your responsibility to reopen the bug report if necessary, and/or fix the problem forthwith. (NB: If you are a system administrator and have no idea what this message is talking about, this may indicate a serious mail system misconfiguration somewhere. Please contact [email protected] immediately.) --=20 468: https://bugs.devuan.org/cgi/bugreport.cgi?bug=3D468 Devuan Bug Tracking System Contact [email protected] with problems ------------=_1674580802-15641-0 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by bugs.devuan.org; 21 May 2020 15:40:03 +0000 Return-Path: <[email protected]> Delivered-To: [email protected] Received: from tupac3.dyne.org [195.169.149.119] by doc.devuan.org with IMAP (fetchmail-6.4.0.beta4) for <debbugs@localhost> (single-drop); Thu, 21 May 2020 15:40:03 +0000 (UTC) Received: from omega.myqiq.info (omega.myqiq.info [72.52.170.129]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by vm6.ganeti.dyne.org (Postfix) with ESMTPS id 5A205F60CBE for <[email protected]>; Thu, 21 May 2020 17:33:39 +0200 (CEST) Authentication-Results: vm6.ganeti.dyne.org; dkim=pass (2048-bit key; unprotected) header.d=pwduffy.org.uk [email protected] header.b="NJRbiZ3l"; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=pwduffy.org.uk; s=default; h=Content-Transfer-Encoding:Mime-Version: Message-ID:Date:Content-Type:To:Reply-To:From:Subject:Sender:Cc:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=E4N8Ir03HzmIbDIXVOGvyRmziSQ+8mVaWBLV3bPI77Q=; b=NJRbiZ3lxCdcnpr+0dyCkzMvQT gJW9KCSoInGPd6WNbLj0AewbjH54NThQMw9ZYBYF99rApGkYt13iAjed1y2hYwx30HS4sAV0AnfR3 4cOQNdnCyFrm0UZKxSAJZYvVzmqjz5+v15qXj/bMKSQl5+2Fl9cHkEarVnBftHC1+4E9yD2Lofpq2 FuuxDBUnvyp5Q2uSt3oSiqd423kkMXlDUr1TuGd4vDQDWkpfXjKBq9rd1EH4ReLiQRutU6KORwepW SuT3vrPk/gF7XrCnND2L0gUQ7/wVFMDDOBzJV4knZRJlpzy2i/225Qy9TS3C1FwAerPBBZfCvULaK SvKC4FpQ==; Received: from cpc118362-brad23-2-0-cust385.17-1.cable.virginm.net ([86.14.225.130]:58938 helo=[192.168.1.86]) by omega.myqiq.info with esmtpa (Exim 4.93) (envelope-from <[email protected]>) id 1jbnCS-00BIUU-LZ for [email protected]; Thu, 21 May 2020 15:33:36 +0000 Subject: python platform.linux_distribution() returns debian From: Peter Duffy <[email protected]> Reply-To: [email protected] To: [email protected] Content-Type: text/plain; charset="UTF-8" Date: Thu, 21 May 2020 16:33:35 +0100 Message-ID: <[email protected]> Mime-Version: 1.0 X-Mailer: Evolution 2.32.3 (2.32.3-34.el6) Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - omega.myqiq.info X-AntiAbuse: Original Domain - bugs.devuan.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - pwduffy.org.uk X-Get-Message-Sender-Via: omega.myqiq.info: authenticated_id: [email protected] X-Authenticated-Sender: omega.myqiq.info: [email protected] X-Source: X-Source-Args: X-Source-Dir: X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,SPF_PASS autolearn=disabled version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tupac3.dyne.org Package: libpython2.7-minimal Version: 2.7.13 Environment in which bug seen: Devuan 2.1 (ascii) Problem behaviour: python function platform.linux_distribution() returns "debian" instead of "devuan" To reproduce: (from command-line): python (from python prompt): import platform platform.linux_distribution() (should return: "('debian','9','')" quit() Test fix: platform.linux_distribution() tries to use the file /etc/lsb-release. This doesn't appear to exist either in Debian stretch or Devuan ascii - unless it's present in a package which isn't included in the default install. Creating it with appropriate values fixes the problem: Check whether /etc/lsb-release exists: it shouldn't, - but if so, rename it (and rename it back after the test). lsb_release -a > /etc/lsb-release Edit /etc/lsb-release and change as follows: "Distributor ID: " => "DISTRIB_ID=" "Description: " => "DISTRIB_DESCRIPTION=" "Release: " => "DISTRIB_RELEASE=" "Codename: " => "DISTRIB_CODENAME=" Above test should now return: "('Devuan','2.1','ascii')" Additional information: The problem is apparently caused by the combination of the absence of /etc/lsb-release, and the presence of /etc/debian_release. The algorithm in platform.linux_distribution() is apparently to try reading /etc/lsb-release, and if it doesn't exist, look for any file matching /etc/*_(version|release) The bug also exists in python3 (package libpython3.5-minimal, version 3.5.3) - to reproduce, repeat the above test using "python3" instead of "python" The bug also exists in beowulf Not sure whether above "fix" is feasible in practice - maybe other python-based packages rely on getting back "debian" from platform.linux_distribution()? This problem came to light because it breaks the waagent package - because it believes that it's running on debian, waagent tries to use systemd-based commands and functions. I'm currently working this problem, but I'm approaching it by putting in place internal tests to ascertain whether debian or devuan, rather than relying on a system-level fix. platform.linux_distribution() is deprecated and slated for removal If it's decided that this can be safely fixed by creating /etc/lsb-release, one question needs answering: whether to lowercase the DISTRIB_ID field, or to leave it as returned by lsb_release ------------=_1674580802-15641-0 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 468-done) by bugs.devuan.org; 24 Jan 2023 17:18:02 +0000 Return-Path: <[email protected]> Delivered-To: [email protected] Received: from email.devuan.org [2001:41d0:2:d06e::5c4:2612] by doc.devuan.org with IMAP (fetchmail-6.4.16) for <debbugs@localhost> (single-drop); Tue, 24 Jan 2023 17:18:02 +0000 (UTC) Received: from email.devuan.org by email.devuan.org with LMTP id NWhoOr8S0GPwKQAAmSBk0A (envelope-from <[email protected]>) for <[email protected]>; Tue, 24 Jan 2023 17:17:51 +0000 Received: by email.devuan.org (Postfix, from userid 109) id E4DB6416; Tue, 24 Jan 2023 17:17:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on email.devuan.org X-Spam-Level: X-Spam-Status: No, score=0.4 required=5.0 tests=RDNS_DYNAMIC,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=193.36.131.86; helo=mx.hindley.org.uk; [email protected]; receiver=<UNKNOWN> Received: from mx.hindley.org.uk (193-36-131-86.cfwn.uk [193.36.131.86]) by email.devuan.org (Postfix) with ESMTPS id 91EEE84 for <[email protected]>; Tue, 24 Jan 2023 17:17:51 +0000 (UTC) Received: from apollo.hindleynet ([192.168.1.3] helo=hindley.org.uk) by mx.hindley.org.uk with smtp (Exim 4.84_2) (envelope-from <[email protected]>) id 1pKMvd-0004sU-VB; Tue, 24 Jan 2023 17:17:50 +0000 Received: (nullmailer pid 19430 invoked by uid 1000); Tue, 24 Jan 2023 17:17:49 -0000 Date: Tue, 24 Jan 2023 17:17:49 +0000 From: Mark Hindley <[email protected]> To: [email protected], [email protected] Subject: Re: bug#468: python platform.linux_distribution() returns debian Message-ID: <[email protected]> References: <[email protected]> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <[email protected]> X-Debbugs-No-Ack: No Thanks Peter, I am going to close this as libpython2.7-minimal was removed from Debian[1] and the python3 platform library doesn't have linux_distribution(). Mark [1] https://bugs.debian.org/1027108 ------------=_1674580802-15641-0--
MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) X-Loop: [email protected] From: "Devuan bug Tracking System" <[email protected]> To: [email protected] Subject: bug#468 closed by Mark Hindley <[email protected]> (Re: bug#468: python platform.linux_distribution() returns debian) Message-ID: <[email protected]> References: <[email protected]> <[email protected]> X-Devuan-PR-Message: they-closed 468 X-Devuan-PR-Package: libpython2.7-minimal Reply-To: [email protected] Date: Tue, 24 Jan 2023 17:20:04 +0000 Content-Type: multipart/mixed; boundary="----------=_1674580804-15641-1" This is a multi-part message in MIME format... ------------=_1674580804-15641-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" This is an automatic notification regarding your bug report which was filed against the libpython2.7-minimal package: #468: python platform.linux_distribution() returns debian It has been closed by Mark Hindley <[email protected]>. Their explanation is attached below along with your original report. If this explanation is unsatisfactory and you have not received a better one in a separate message then please contact Mark Hindley <mark@hin= dley.org.uk> by replying to this email. --=20 468: https://bugs.devuan.org/cgi/bugreport.cgi?bug=3D468 Devuan Bug Tracking System Contact [email protected] with problems ------------=_1674580804-15641-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 468-done) by bugs.devuan.org; 24 Jan 2023 17:18:02 +0000 Return-Path: <[email protected]> Delivered-To: [email protected] Received: from email.devuan.org [2001:41d0:2:d06e::5c4:2612] by doc.devuan.org with IMAP (fetchmail-6.4.16) for <debbugs@localhost> (single-drop); Tue, 24 Jan 2023 17:18:02 +0000 (UTC) Received: from email.devuan.org by email.devuan.org with LMTP id NWhoOr8S0GPwKQAAmSBk0A (envelope-from <[email protected]>) for <[email protected]>; Tue, 24 Jan 2023 17:17:51 +0000 Received: by email.devuan.org (Postfix, from userid 109) id E4DB6416; Tue, 24 Jan 2023 17:17:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on email.devuan.org X-Spam-Level: X-Spam-Status: No, score=0.4 required=5.0 tests=RDNS_DYNAMIC,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=193.36.131.86; helo=mx.hindley.org.uk; [email protected]; receiver=<UNKNOWN> Received: from mx.hindley.org.uk (193-36-131-86.cfwn.uk [193.36.131.86]) by email.devuan.org (Postfix) with ESMTPS id 91EEE84 for <[email protected]>; Tue, 24 Jan 2023 17:17:51 +0000 (UTC) Received: from apollo.hindleynet ([192.168.1.3] helo=hindley.org.uk) by mx.hindley.org.uk with smtp (Exim 4.84_2) (envelope-from <[email protected]>) id 1pKMvd-0004sU-VB; Tue, 24 Jan 2023 17:17:50 +0000 Received: (nullmailer pid 19430 invoked by uid 1000); Tue, 24 Jan 2023 17:17:49 -0000 Date: Tue, 24 Jan 2023 17:17:49 +0000 From: Mark Hindley <[email protected]> To: [email protected], [email protected] Subject: Re: bug#468: python platform.linux_distribution() returns debian Message-ID: <[email protected]> References: <[email protected]> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <[email protected]> X-Debbugs-No-Ack: No Thanks Peter, I am going to close this as libpython2.7-minimal was removed from Debian[1] and the python3 platform library doesn't have linux_distribution(). Mark [1] https://bugs.debian.org/1027108 ------------=_1674580804-15641-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by bugs.devuan.org; 21 May 2020 15:40:03 +0000 Return-Path: <[email protected]> Delivered-To: [email protected] Received: from tupac3.dyne.org [195.169.149.119] by doc.devuan.org with IMAP (fetchmail-6.4.0.beta4) for <debbugs@localhost> (single-drop); Thu, 21 May 2020 15:40:03 +0000 (UTC) Received: from omega.myqiq.info (omega.myqiq.info [72.52.170.129]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by vm6.ganeti.dyne.org (Postfix) with ESMTPS id 5A205F60CBE for <[email protected]>; Thu, 21 May 2020 17:33:39 +0200 (CEST) Authentication-Results: vm6.ganeti.dyne.org; dkim=pass (2048-bit key; unprotected) header.d=pwduffy.org.uk [email protected] header.b="NJRbiZ3l"; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=pwduffy.org.uk; s=default; h=Content-Transfer-Encoding:Mime-Version: Message-ID:Date:Content-Type:To:Reply-To:From:Subject:Sender:Cc:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=E4N8Ir03HzmIbDIXVOGvyRmziSQ+8mVaWBLV3bPI77Q=; b=NJRbiZ3lxCdcnpr+0dyCkzMvQT gJW9KCSoInGPd6WNbLj0AewbjH54NThQMw9ZYBYF99rApGkYt13iAjed1y2hYwx30HS4sAV0AnfR3 4cOQNdnCyFrm0UZKxSAJZYvVzmqjz5+v15qXj/bMKSQl5+2Fl9cHkEarVnBftHC1+4E9yD2Lofpq2 FuuxDBUnvyp5Q2uSt3oSiqd423kkMXlDUr1TuGd4vDQDWkpfXjKBq9rd1EH4ReLiQRutU6KORwepW SuT3vrPk/gF7XrCnND2L0gUQ7/wVFMDDOBzJV4knZRJlpzy2i/225Qy9TS3C1FwAerPBBZfCvULaK SvKC4FpQ==; Received: from cpc118362-brad23-2-0-cust385.17-1.cable.virginm.net ([86.14.225.130]:58938 helo=[192.168.1.86]) by omega.myqiq.info with esmtpa (Exim 4.93) (envelope-from <[email protected]>) id 1jbnCS-00BIUU-LZ for [email protected]; Thu, 21 May 2020 15:33:36 +0000 Subject: python platform.linux_distribution() returns debian From: Peter Duffy <[email protected]> Reply-To: [email protected] To: [email protected] Content-Type: text/plain; charset="UTF-8" Date: Thu, 21 May 2020 16:33:35 +0100 Message-ID: <[email protected]> Mime-Version: 1.0 X-Mailer: Evolution 2.32.3 (2.32.3-34.el6) Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - omega.myqiq.info X-AntiAbuse: Original Domain - bugs.devuan.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - pwduffy.org.uk X-Get-Message-Sender-Via: omega.myqiq.info: authenticated_id: [email protected] X-Authenticated-Sender: omega.myqiq.info: [email protected] X-Source: X-Source-Args: X-Source-Dir: X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,SPF_PASS autolearn=disabled version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tupac3.dyne.org Package: libpython2.7-minimal Version: 2.7.13 Environment in which bug seen: Devuan 2.1 (ascii) Problem behaviour: python function platform.linux_distribution() returns "debian" instead of "devuan" To reproduce: (from command-line): python (from python prompt): import platform platform.linux_distribution() (should return: "('debian','9','')" quit() Test fix: platform.linux_distribution() tries to use the file /etc/lsb-release. This doesn't appear to exist either in Debian stretch or Devuan ascii - unless it's present in a package which isn't included in the default install. Creating it with appropriate values fixes the problem: Check whether /etc/lsb-release exists: it shouldn't, - but if so, rename it (and rename it back after the test). lsb_release -a > /etc/lsb-release Edit /etc/lsb-release and change as follows: "Distributor ID: " => "DISTRIB_ID=" "Description: " => "DISTRIB_DESCRIPTION=" "Release: " => "DISTRIB_RELEASE=" "Codename: " => "DISTRIB_CODENAME=" Above test should now return: "('Devuan','2.1','ascii')" Additional information: The problem is apparently caused by the combination of the absence of /etc/lsb-release, and the presence of /etc/debian_release. The algorithm in platform.linux_distribution() is apparently to try reading /etc/lsb-release, and if it doesn't exist, look for any file matching /etc/*_(version|release) The bug also exists in python3 (package libpython3.5-minimal, version 3.5.3) - to reproduce, repeat the above test using "python3" instead of "python" The bug also exists in beowulf Not sure whether above "fix" is feasible in practice - maybe other python-based packages rely on getting back "debian" from platform.linux_distribution()? This problem came to light because it breaks the waagent package - because it believes that it's running on debian, waagent tries to use systemd-based commands and functions. I'm currently working this problem, but I'm approaching it by putting in place internal tests to ascertain whether debian or devuan, rather than relying on a system-level fix. platform.linux_distribution() is deprecated and slated for removal If it's decided that this can be safely fixed by creating /etc/lsb-release, one question needs answering: whether to lowercase the DISTRIB_ID field, or to leave it as returned by lsb_release ------------=_1674580804-15641-1--
Devuan BTS -- Powered by Debian bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997 nCipher Corporation Ltd,
1994-97 Ian Jackson.
Devuan Bugs Owner <[email protected]>.
Last modified:
Tue, 3 Dec 2024 00:39:01 UTC