Describe the bugezdxf.units.unit_name should return the string of the unit name for a given integer of INSUNITS, but in some environment it always returns "unitless" regardless of an input.
I guess this happens in Python 3.11 or later because since then the behaviour of IntEnum.__str__ has been changed as follows:
Changed in version 3.11: str() is now int.str() to better support the replacement of existing constants use-case. format() was already int.format() for that same reason.
(I think the implementation of unit_name can just use InsertUnits(enum).name instead of str().)
Thank you for maintaining this awesome package!
Describe the bug
ezdxf.units.unit_name
should return the string of the unit name for a given integer of INSUNITS, but in some environment it always returns"unitless"
regardless of an input.I guess this happens in Python 3.11 or later because since then the behaviour of
IntEnum.__str__
has been changed as follows:https://docs.python.org/3/library/enum.html#enum.IntEnum
(I think the implementation of
unit_name
can just useInsertUnits(enum).name
instead ofstr()
.)To Reproduce
As mentioned above, this should be reproduced in Python 3.11 (or later, but I haven't checked that).
Expected behavior