CauldronDevelopmentLLC / cbang

C! (cbang) is a library for cross-platform C++ development.
GNU Lesser General Public License v2.1
56 stars 39 forks source link

Python platform.dist() is buggy #150

Closed marcosfrm closed 7 months ago

marcosfrm commented 8 months ago

https://github.com/CauldronDevelopmentLLC/cbang/blob/aaefdf524cfbc05320c3c16437d3593a106b8333/config/packager/__init__.py#L43

It was removed in Python 3.8. With Python 3.6 from openSUSE Leap 15.5:

Python 3.6.15 (default, Sep 23 2021, 15:41:43) [GCC] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import platform
>>> hasattr(platform, 'dist')
True
>>> print(platform.dist())
('', '', '')
>>> 

Too many bugs: https://bugs.python.org/issue28167

kbernhagen commented 8 months ago

Is the recommended replacement distro?

marcosfrm commented 8 months ago

Yes, but /etc/os-release is already parsed in get_dist(). Maybe platform.dist() was useful before /etc/os-release standardization. Any non-ancient Linux distribution has /etc/os-release now.

marcosfrm commented 7 months ago

@jcoffland Can we simply remove platform.dist() usage?

jcoffland commented 7 months ago

done