CodeReview
CodeReview copied to clipboard
AttributeError: module 'platform' has no attribute 'dist'
When I execute pyqgit I get an exception followed by a segfault.
/usr/lib/python3.8/site-packages/CodeReview/Logging/Logging.py:52: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
logging_config = yaml.load(open(logging_config_file_name, 'r'))
2020-01-28 00:11:05,226 - pyqgit - Logging.setup_logging - INFO - Start pyqgit
2020-01-28 00:11:05,248 - CodeReview.GUI.LogBrowser.LogBrowserApplication - ApplicationBase.__init__ - DEBUG - Namespace(path='/home/michi', user_script=None, user_script_args='') {}
Traceback (most recent call last):
File "/usr/bin/pyqgit", line 67, in <module>
application = LogBrowserApplication(args)
File "/usr/lib/python3.8/site-packages/CodeReview/GUI/LogBrowser/LogBrowserApplication.py", line 47, in __init__
super(LogBrowserApplication, self).__init__(args=args)
File "/usr/lib/python3.8/site-packages/CodeReview/GUI/Base/GuiApplicationBase.py", line 58, in __init__
super(GuiApplicationBase, self).__init__(args=args, **kwargs)
File "/usr/lib/python3.8/site-packages/CodeReview/Application/ApplicationBase.py", line 49, in __init__
self._platform = Platform()
File "/usr/lib/python3.8/site-packages/CodeReview/Tools/Platform.py", line 50, in __init__
self.distribution = ' '.join(platform.dist())
AttributeError: module 'platform' has no attribute 'dist'
QWidget: Must construct a QApplication before a QWidget
Abgebrochen (Speicherabzug geschrieben)
My system:
- Python 3.8.1 (default, Jan 8 2020, 23:09:20)
- [GCC 9.2.0] on linux
- python-pyqt5 5.14.1
- Arch Linux
Please let me know if I can provide you more information needed. Thanks a lot! (Haven't tried it yet but screenshots look promising)
Commenting out the call of platform.dist()
fixes the issue.
- platform.dist is deprecated since python version 2.6.
- platform.linux_distribution was the successor but is deprecated since Python 3.5 and removed in Python 3.8
- This seem to be the successor: https://pypi.org/project/distro/
Was able to build from source but the official pypi repo seems to be outdated and the build has the above-mentioned problem