The benchmark-results.txt has wrong operating system records for Ubuntu #56314

Closed
opened 2018-08-11 14:16:25 +02:00 by Jonas Brink · 8 comments

Case
When using the blender benchmark 1.0beta, saving the benchmark-results.txt with a Ubuntu 18.04.1 machine results in JSON wrong records:

"dist_name": "debian",
"dist_version": "buster/sid", 

This contradicts with the distribution supplied tuple ('Ubuntu', '18.04', 'bionic').

How To Reproduce

  • Prerequisites: Ubuntu x64 18.04.1 machine with python version 3.6.5 (I think this works for any Ubuntu version)
  • Open terminal and type
$ blender-benchmark-1.0beta-linux-glibc219-x86_64/2.80/python/bin/python3.6m
>>> import platform
>>> platform.linux_distribution()

('debian', 'buster/sid', '')

Problem

To find the bug, I compared the system supplied platform.py (/usr/lib/python3.6/platform.py) with the blender supplied (blender-benchmark-1.0beta-linux-glibc219-x86_64/2.80/python/lib/python3.6/platform.py), and indeed the lines determining the ubuntu version are missing.
NOTE: This is also the case for "blender-2.80-d7b5e2fa72c-linux-glibc219-x86_64". So the supplied solution idea should work for the official blender tree.

Solution
A simple replacement of the buggy file with the official Python Software Foundation owned one should work as the lines determining the Ubuntu version are the only differences in the whole file.

**Case** When using the blender benchmark 1.0beta, saving the benchmark-results.txt with a Ubuntu 18.04.1 machine results in JSON wrong records: ``` "dist_name": "debian", "dist_version": "buster/sid", ``` This contradicts with the distribution supplied tuple *('Ubuntu', '18.04', 'bionic')*. **How To Reproduce** - Prerequisites: Ubuntu x64 18.04.1 machine with python version 3.6.5 (I think this works for any Ubuntu version) - Open terminal and type ``` $ blender-benchmark-1.0beta-linux-glibc219-x86_64/2.80/python/bin/python3.6m >>> import platform >>> platform.linux_distribution() ('debian', 'buster/sid', '') ``` **Problem** To find the bug, I compared the system supplied platform.py (/usr/lib/python3.6/platform.py) with the blender supplied (blender-benchmark-1.0beta-linux-glibc219-x86_64/2.80/python/lib/python3.6/platform.py), and indeed the lines determining the ubuntu version are missing. NOTE: This is also the case for "blender-2.80-d7b5e2fa72c-linux-glibc219-x86_64". So the supplied solution idea should work for the official blender tree. **Solution** A simple replacement of the buggy file with the official Python Software Foundation owned one should work as the lines determining the Ubuntu version are the only differences in the whole file.
Author

Added subscriber: @jbrink

Added subscriber: @jbrink

Added subscriber: @mont29

Added subscriber: @mont29

We are using official python files, most likely ours is slightly older, that’s all. Note that we are going to switch to py3.7 (hopefully 3.7.1 if it comes out soon enough), so that should fix it.

We are using official python files, most likely ours is slightly older, that’s all. Note that we are going to switch to py3.7 (hopefully 3.7.1 if it comes out soon enough), so that should fix it.
Author

Ok. I took a look at the python-dev git and as of commit 8b94b41ab7b12f745dea744e8940631318816935 (2018-05-16), the function platform.linux_distribution() is no longer in the PSF python tree. It has been deprecated since version 3.5 and will be removed in 3.8. But even if you pick a version prior to said commit (say 3.7), the supplied platform.py still has the bug mentioned in the beginning. One way is to use https://pypi.org/project/distro which is mentioned in the discussion on bugs.python.org.

See https:*bugs.python.org/issue28167 or https:*docs.python.org/3/library/platform.html or 8b94b41ab7b12f745dea744e8940631318816935@https://github.com/python/cpython/Lib/platform.py.

Ok. I took a look at the python-dev git and as of commit **8b94b41ab7b12f745dea744e8940631318816935** (2018-05-16), the function platform.linux_distribution() is no longer in the PSF python tree. It has been deprecated since version 3.5 and will be removed in 3.8. But even if you pick a version prior to said commit (say 3.7), the supplied platform.py still has the bug mentioned in the beginning. One way is to use https://pypi.org/project/distro which is mentioned in the discussion on bugs.python.org. See https:*bugs.python.org/issue28167 or https:*docs.python.org/3/library/platform.html or 8b94b41ab7b12f745dea744e8940631318816935@https://github.com/python/cpython/Lib/platform.py.

Added subscriber: @dr.sybren

Added subscriber: @dr.sybren

The platform.linux_distribution() function works fine on my Ubuntu 17.10 install. However, it's clearly deprecated and distro can be stripped down to just one file (distro.py) that we can bundle easily. Thanks for doing the digging and making fixing this easy!

The `platform.linux_distribution()` function works fine on my Ubuntu 17.10 install. However, it's clearly deprecated and [distro](https://pypi.org/project/distro) can be stripped down to just one file (`distro.py`) that we can bundle easily. Thanks for doing the digging and making fixing this easy!
This issue was referenced by infrastructure/blender-benchmark-bundle@84faded0cc279f345670b43f8cfb3936ccf0199b

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
Sign in to join this conversation.
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: infrastructure/blender-open-data#56314
No description provided.