Hello,

there is no need to continuously to reproduce this, as it is a standard
python interpret feature to catch SIGPIPE, raise BrokenPipeError on
interpreter exit, and print a message about it to stderr. It is an error
condition in python's opinion, and it does say so.

In my opinion, this is not even a bug.

Why does an extra message on stderr, causes any problems to you, and why
are you calling/testing for ubuntu versions like that? Can you not
redirect stderr to /dev/null, as recommended in
https://bugs.launchpad.net/ubuntu/+source/lsb/+bug/1504127/comments/3 ?

Note that as per
https://bugs.launchpad.net/ubuntu/+source/lsb/+bug/1504127/comments/3
there is no work ongoing to resolve the reported issue.

Could you please explain which software package invocates commands like
that and what the goal is?

checking /proc/version is not that useful, because it only says which kernel is 
currently running which may not match userspace (e.g. Debian lxd container on 
Ubuntu kernel is not Ubuntu, or Ubuntu container on a foreign kernel is). If 
parsing /etc/os-release was enough, why do you still (pointlessly) invoke a 
python interpreter to parse lsb_release?
lsb_release is deprecated, and imho /usr/lib/os-release should be preferred. 
Legacy release might only have /etc/os-release or just /etc/lsb-release.

I would avoid all forks all together:
$ grep -iq Ubuntu /etc/os-release /usr/lib/os-release /etc/lsb-release

Please change your code to detect Ubuntu as per ^ for example. Or otherwise the 
caller that closes stdout of lsb_release, should also redirect stderr if said 
caller doesn't want to tolerate it, e.g.:
$ ( cat /etc/os-release /proc/version; lsb_release -is 2>/dev/null) | grep -iq 
Ubuntu

** Changed in: lsb (Ubuntu)
       Status: Triaged => Invalid

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1504127

Title:
  lsb_release throws exception if stdout is closed

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/lsb/+bug/1504127/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to