summaryrefslogtreecommitdiff
path: root/CONTRIBUTING.rst
diff options
context:
space:
mode:
authorMarkus Heiser <markus.heiser@darmarit.de>2025-10-07 15:47:03 +0200
committerMarkus Heiser <markus.heiser@darmarIT.de>2025-10-08 13:47:22 +0200
commitd16283d93a7b7b691bf12c13db1f1020829b4278 (patch)
treebe95a529032b4c53505cdf12c7cbe3d454a45762 /CONTRIBUTING.rst
parent8fdc59a7604cd661638586ff0381530da86eb76c (diff)
[fix:py3.14] using a non-empty mutable collection as default is unsafe
Starting with Python 3.14 msgspec reports:: File "/share/searxng/searx/weather.py", line 261, in <module> class Temperature(msgspec.Struct, kw_only=True): ...<60 lines>... return template.format(value=val_str, unit=unit) TypeError: Using a non-empty mutable collection (['°C', '°F', 'K']) \ as a default value is unsafe.\ Instead configure a `default_factory` for this field. The problem is solved by the fact that there are now global constants for the units (BTW singular/plural names of the type definitions are fixed): - TEMPERATURE_UNITS - PRESSURE_UNITS - WIND_SPEED_UNITS - RELATIVE_HUMIDITY_UNITS - COMPASS_POINTS - COMPASS_UNITS Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Diffstat (limited to 'CONTRIBUTING.rst')
0 files changed, 0 insertions, 0 deletions