One function

_get_cpu_info_from_cpufreq_info in workhorsy/py-cpuinfo

The author described this change as Fixed Bug #41: Broken on Odroid XU3 armhf ARM 32bit. It counts as a record because the check below fails on the code as it stood at 36e639555 and passes on a925e8567, with nothing else changed between the two runs.

Fix saved2017-04-10
Sharing licenceMIT · LICENSE
Change size+4 1

What the code was meant to do, written into the code itself as a docstring

Returns the CPU info gathered from cpufreq-info. Returns {} if cpufreq-info is not found.

The change

1313 if returncode != 0:
1414 return {}
1515
16- hz_brand = output.split('current CPU frequency is')[1].split('\n')[0].rsplit('.', 1)[0].lower().strip()
16+ hz_brand = output.split('current CPU frequency is')[1].split('\n')[0]
17+ i = hz_brand.find('Hz')
18+ assert(i != -1)
19+ hz_brand = hz_brand[0 : i+2].strip().lower()
1720
1821 if hz_brand.endswith('mhz'):
1922 scale = 6

The check that tells the two apart

failpass·tests/test_linux_odroid_xu3_arm_32.py::TestLinux_Odroid_XU3_arm_32::test_get_cpu_info_from_cpufreq_info

Check file tests/test_linux_odroid_xu3_arm_32.py, taken without changes from the fix and copied onto the older code, so the exact same check runs against both versions.

Origin and history

The code before it36e639555721c823e903356180fbab893775c770
Broken version dated2017-04-10
Modulecpuinfo.cpuinfo
Units changed_get_cpu_info_from_cpufreq_info
Fingerprintc7558e58543cf754
Checked2026-08-18 by goldset/0.1

Every field above is generated by our program. None of it is written by hand.

Other bugs found in workhorsy/py-cpuinfo