diff options
| author | Markus Heiser <markus.heiser@darmarit.de> | 2025-10-07 15:47:03 +0200 |
|---|---|---|
| committer | Markus Heiser <markus.heiser@darmarIT.de> | 2025-10-08 13:47:22 +0200 |
| commit | d16283d93a7b7b691bf12c13db1f1020829b4278 (patch) | |
| tree | be95a529032b4c53505cdf12c7cbe3d454a45762 /.github/workflows | |
| parent | 8fdc59a7604cd661638586ff0381530da86eb76c (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 '.github/workflows')
0 files changed, 0 insertions, 0 deletions