From 408d6c370d9613da46ebd6cf3ca6d2ab236cdc48 Mon Sep 17 00:00:00 2001 From: Todd Leonhardt Date: Sun, 14 Sep 2025 16:18:35 -0400 Subject: [PATCH] Replace codecs.open() with open() since codecs.open() deprecated in Python 3.14 This is to address Issue #8446 Also: - Added uv.lock to .gitignore to make it easier to test with uv virtual environments using things like a release candidate version of Python --- .gitignore | 3 +++ material/extensions/emoji.py | 3 +-- src/extensions/emoji.py | 3 +-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 2cafc25fce3..b6172d9f34d 100644 --- a/.gitignore +++ b/.gitignore @@ -65,3 +65,6 @@ tmp # IDEs & Editors .idea *~ + +# uv Python package manager +uv.lock diff --git a/material/extensions/emoji.py b/material/extensions/emoji.py index 0a5e14315bf..46e3981464d 100644 --- a/material/extensions/emoji.py +++ b/material/extensions/emoji.py @@ -20,7 +20,6 @@ from __future__ import annotations -import codecs import functools import material import os @@ -65,7 +64,7 @@ def to_svg( # Load icon @functools.lru_cache(maxsize = None) def _load(file: str): - with codecs.open(file, encoding = "utf-8") as f: + with open(file, encoding = "utf-8") as f: return f.read() # Load twemoji index and add icons diff --git a/src/extensions/emoji.py b/src/extensions/emoji.py index 0a5e14315bf..46e3981464d 100644 --- a/src/extensions/emoji.py +++ b/src/extensions/emoji.py @@ -20,7 +20,6 @@ from __future__ import annotations -import codecs import functools import material import os @@ -65,7 +64,7 @@ def to_svg( # Load icon @functools.lru_cache(maxsize = None) def _load(file: str): - with codecs.open(file, encoding = "utf-8") as f: + with open(file, encoding = "utf-8") as f: return f.read() # Load twemoji index and add icons