Title: fix: replace deprecated codecs.open with built-in open (#128) by mvanhorn · Pull Request #134 · gitpython-developers/gitdb · GitHub
Open Graph Title: fix: replace deprecated codecs.open with built-in open (#128) by mvanhorn · Pull Request #134 · gitpython-developers/gitdb
X Title: fix: replace deprecated codecs.open with built-in open (#128) by mvanhorn · Pull Request #134 · gitpython-developers/gitdb
Description: 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: gitdb/db/ref.py:45: DeprecationWarning: codecs.open() is deprecated. Use open() instead. with codecs.open(self._ref_file, 'r', encoding="utf-8") as f: 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 pytest gitdb/test/db/test_ref.py — 1 passed grep -rn 'codecs.open' --include='*.py' — 0 matches after the change
Open Graph Description: 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="...
X Description: 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&...
Opengraph URL: https://github.com/gitpython-developers/gitdb/pull/134
X: @github
Domain: redirect.github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:272e5420-741f-4ebe-3b5c-3998092c3032 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | CD7C:3FA90B:EC1922:144DAD5:6A55C603 |
| html-safe-nonce | e5e77779112883df2574f25caa853e020b26af408281a25320d898adb4245b8f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDRDdDOjNGQTkwQjpFQzE5MjI6MTQ0REFENTo2QTU1QzYwMyIsInZpc2l0b3JfaWQiOiI3MTEyNzkzMTY3NzEyNjAxNjAzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 6a2b4e2b04983e3d3b649841222794fd2908f3ff74782b97b582c1b3327585e6 |
| hovercard-subject-tag | pull_request:3607907415 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/gitpython-developers/gitdb/pull/134/files |
| twitter:image | https://avatars.githubusercontent.com/u/455140?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/455140?s=400&v=4 |
| og:image:alt | 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="... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | b5665c84831ed9ac4fb79519c16c9c5580ba8092fb8bb6e3e72972ec7197348e |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/gitpython-developers/gitdb git https://github.com/gitpython-developers/gitdb.git |
| octolytics-dimension-user_id | 503709 |
| octolytics-dimension-user_login | gitpython-developers |
| octolytics-dimension-repository_id | 1126093 |
| octolytics-dimension-repository_nwo | gitpython-developers/gitdb |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1126093 |
| octolytics-dimension-repository_network_root_nwo | gitpython-developers/gitdb |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8f8e1726192df8dce16872ceb503336c12e9ae78 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width