-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error while backup favorites #39
Comments
super quick fix, i hope somebody sees it lol @ephes @alexdetsch @luebbert42 in repository.py add utf8 encodings in the functions:
you can do it in your local code @BigDi |
Well, pydantic deliberately returns a unicode string when Hmm, maybe it's enough just to overwrite the operating system default by calling: with self.path.open("w", encoding="utf-8") as f:
f.write(models.model_dump_json()) This is still normal text mode, but would overwrite the default encoding and use utf-8. Can you try this and tell me if it works on windows? |
I can confirm that the additional encoding solves the problem on windows. |
Cool! I'll released 0.0.21 containing the fix. |
Get a traceback while backuping my 1086 favorites.
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ C:\Python311\Lib\site-packages\kptncook_init_.py:167 in backup_kptncook_favorites │
│ │
│ 164 │ │ sys.exit(1) │
│ 165 │ │
│ 166 │ fs_repo = RecipeRepository(settings.root) │
│ ❱ 167 │ fs_repo.add_list(recipes) │
│ 168 │ rprint(f"Added {len(recipes)} recipes to local repository") │
│ 169 │
│ 170 │
│
UnicodeEncodeError: 'charmap' codec can't encode character '\u202f' in position 829203: character maps to
The text was updated successfully, but these errors were encountered: