LinuxCNC / linuxcnc

LinuxCNC controls CNC machines. It can drive milling machines, lathes, 3d printers, laser cutters, plasma cutters, robot arms, hexapods, and more.
http://linuxcnc.org/
GNU General Public License v2.0
1.81k stars 1.16k forks source link

Fix module 'locale' has no attribute 'format' #2776

Closed dwrobel closed 11 months ago

dwrobel commented 11 months ago

Fixes the following error on python 3.12: Traceback (most recent call last): File "/usr/lib/python3.12/site-packages/qtvcp/widgets/origin_offsetview.py", line 383, in periodic_check self.reload_offsets() File "/usr/lib/python3.12/site-packages/qtvcp/widgets/origin_offsetview.py", line 270, in reload_offsets degree_tmpl = "%{}.2f".format(len(locale.format(tmpl, 0))) ^^^^^^^^^^^^^ AttributeError: module 'locale' has no attribute 'format'. Did you mean: '_format'?

See also: https://github.com/python/cpython/issues/94226

hansu commented 11 months ago

Looks good to me. Should better go into 2.9 I think.

c-morley commented 11 months ago

I think locale is an artifact from converting from gladevcp anyways. Will back port/remove if required later. Thanks.