There was a problem hiding this comment.
Thanks a lot, good catch!
Sorry, something went wrong.
There was a problem hiding this comment.
This PR addresses Python 3.14 deprecation warnings by replacing usage of codecs.open() with the built-in open() when reading the reference file for ReferenceDB.
Changes:
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Sorry, something went wrong.
Fixes #128.
What changed
gitdb/db/ref.py:45 used codecs.open(self._ref_file, 'r', encoding="utf-8"). Replaced it with the built-in open(self._ref_file, 'r', encoding="utf-8") and dropped the now-unused import codecs.
Why this matters
Running the test suite under Python 3.14 emits the warning quoted in the issue:
The built-in open() has accepted the encoding keyword since Python 3.0, and the call site already passed encoding="utf-8", so the replacement is byte-for-byte equivalent on every supported Python version. @Byron's comment on the issue ("if using open in its place is backwards compatible within the v3 version of python, this should be an easy fix") is exactly what this is.
Verification