3b4c3e6e17
* Fix prometheus component to fully santize Unicode characters. Sanitization used isdigit() to match numerics but that also matches Unicode "digit" characters that require special handling, like superscripts. Failures would look like this: ValueError: Invalid metric name: sensor_unit_u0x23_per_m³ Changed sanitize to use string.digits, which matches only ascii digits, and added test. See https://stackoverflow.com/questions/44891070/whats-the-difference-between-str-isdigit-isnumeric-and-isdecimal-in-python for discussion. https://docs.python.org/3/library/stdtypes.html#str.isdigit https://docs.python.org/3.7/library/string.html#string.digits * fix formatting to comply with black |
||
---|---|---|
.. | ||
__init__.py | ||
test_init.py |