From f60bc470e96fb8c91cbded0a0be39f892e167886 Mon Sep 17 00:00:00 2001 From: purarue <7804791+purarue@users.noreply.github.com> Date: Wed, 14 Jan 2026 19:03:23 -0800 Subject: [PATCH] Fix: use builtin dataclasses.fields instead of __annotations__ in python3.14, computing the __annotations__ is done lazily which leads to an error. see https://docs.python.org/3/whatsnew/3.14.html#implications-for-readers-of-annotations --- trakt/config.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/trakt/config.py b/trakt/config.py index 62bf868..bf91019 100644 --- a/trakt/config.py +++ b/trakt/config.py @@ -3,7 +3,7 @@ __author__ = 'Elan Ruusamäe' import json -from dataclasses import dataclass +from dataclasses import dataclass, fields from os.path import exists from typing import Optional @@ -40,7 +40,8 @@ def update(self, **kwargs): def all(self): result = {} - for key in self.__annotations__.keys(): + for field in fields(self): + key = field.name result[key] = self.get(key) return result @@ -55,7 +56,8 @@ def load(self): with open(self.config_path) as config_file: config_data = json.load(config_file) - for key in self.__annotations__.keys(): + for field in fields(self): + key = field.name # Don't overwrite if self.get(key) is not None: continue