-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Description
Context
When building documentation using MkDocs with the Material Theme in virtual environment using Python 3.14.0rc2, I got the following warning:
INFO - DeprecationWarning: codecs.open() is deprecated. Use open() instead.
File ".venv/lib/python3.14/site-packages/material/extensions/emoji.py", line 53, in to_svg
el.text = md.htmlStash.store(_load(icons[shortname]["path"]))
File ".venv/lib/python3.14/site-packages/material/extensions/emoji.py", line 68, in _load
with codecs.open(file, encoding = "utf-8") as f:
This is the line causing the problems in emoji.py:
def _load(file: str):
with codecs.open(file, encoding = "utf-8") as f:
return f.read()
Proposed solution, just replace codecs.open
with open
and remove the import for codecs
:
def _load(file: str):
with open(file, encoding = "utf-8") as f:
return f.read()
I don't understand why your code tree duplicates files, but the file appears to be located at these two locations:
- material/extensions/emoji.py
- src/extensions/emoji.py
Bug description
codecs.open
is deprecated as of Python 3.14 and open
should be used instead.
Related links
Reproduction
mkdocs build -s
using latest version of MkDocs and Material Theme with Python 3.14
Steps to reproduce
mkdocs build -s
using latest version of MkDocs and Material Theme with Python 3.14
Note: I tried building the zip-file you want, but couldn't. This is a very straightforward issue with a clear 1 or 2 line solution.
Browser
No response
Before submitting
- I have read and followed the bug reporting guidelines.
- I have attached links to the documentation, and possibly related issues and discussions.
- I assure that I have removed all customizations before submitting this bug report.
- I have attached a .zip file with a minimal reproduction using the built-in info plugin.