Replace codecs.open() with open() since codecs.open() deprecated in 3.14#8447
Conversation
…ython 3.14 This is to address Issue squidfunk#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
|
Thanks for the PR. The code was adapted from @facelessuser's extension. Maybe he can shortly comment on why |
|
@squidfunk I updated the description with this text explaining that Python 2 required using
And yes this still works with I believe all versions of Python 3, certainly including 3.8. |
|
For |
|
Thanks, that makes sense! Python 2, wow, that feels distant. I think this should be good to merge then. |
|
@squidfunk Thank you for creating and maintaining such a wonderful documentation system! I've been using it for a bit under a year now after moving to it from Sphinx and I really love it. |
|
I don't know exactly what MkDocs Material relies on, but I will note that |
|
@facelessuser perfect, thanks for noting! If we discover problems along the way, we can add the strict parameter. |
Replace
codecs.open()withopen()since the former is deprecated in Python 3.14codecs.openwas necessary in Python 2 because the built-inopen()function could not handle different text encodings like UTF-8. It provided a way to read and write text files containing Unicode characters, which the default open() could not do without causing errors. With Python 3, the built-inopen()function was changed to take an encoding argument and to handle text files as Unicode by defaultAlso:
uv.lockto.gitignoreto make it easier to test with uv virtual environments using things like a release candidate version of PythonCloses #8446