Title: Encoding issue with tags in packed-refs file · Issue #2064 · gitpython-developers/GitPython · GitHub
Open Graph Title: Encoding issue with tags in packed-refs file · Issue #2064 · gitpython-developers/GitPython
X Title: Encoding issue with tags in packed-refs file · Issue #2064 · gitpython-developers/GitPython
Description: Tags found in the packed-refs file that can be created by the Git command git pack-refs do not have to be UTF8 encoded. In these cases, GitPython fails to read these tags due to assuming they should be UTF8 compatible. The source for thi...
Open Graph Description: Tags found in the packed-refs file that can be created by the Git command git pack-refs do not have to be UTF8 encoded. In these cases, GitPython fails to read these tags due to assuming they shoul...
X Description: Tags found in the packed-refs file that can be created by the Git command git pack-refs do not have to be UTF8 encoded. In these cases, GitPython fails to read these tags due to assuming they shoul...
Opengraph URL: https://github.com/gitpython-developers/GitPython/issues/2064
X: @github
Domain: redirect.github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Encoding issue with tags in packed-refs file","articleBody":"Tags found in the `packed-refs` file that can be created by the Git command `git pack-refs` do not have to be UTF8 encoded. In these cases, GitPython fails to read these tags due to assuming they should be UTF8 compatible.\n\nThe source for this issue is found here:\nhttps://github.com/gitpython-developers/GitPython/blob/main/git/refs/symbolic.py#L124\n\n```python\nwith open(cls._get_packed_refs_path(repo), \"rt\", encoding=\"UTF-8\") as fp:\n``` \n\nA working example (using a repository with a non-utf8 tag):\n```shell\ngit clone https://github.com/ACRA/acra\ncd acra\n``` \n\nCreate a Python script with the following content:\n```python\nimport git\nrepo = git.Repo(\".\")\nprint(repo.tags)\n```\nExecute the script:\n```shell\npython script.py\n```\nResult:\n`UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc3 in position 6216: invalid continuation byte`","author":{"url":"https://github.com/benmss","@type":"Person","name":"benmss"},"datePublished":"2025-08-06T03:51:19.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/2064/GitPython/issues/2064"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:865138e4-4b4e-1aa8-9afe-033b0a1f9741 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C264:18B65E:10DE02C:173263E:6969FA61 |
| html-safe-nonce | 72933425606ec57920382a597d38e28362ecf1fb2fb6a4d766e23a47fb00fccf |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMjY0OjE4QjY1RToxMERFMDJDOjE3MzI2M0U6Njk2OUZBNjEiLCJ2aXNpdG9yX2lkIjoiODcwNTc1MTI5NDU5ODA1MjQ0OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 9ac84ffd4a0e5e8985a8b9c083d1cbb8934dc9ea117a3c8fd6d1fc15be7f34c6 |
| hovercard-subject-tag | issue:3295083630 |
| github-keyboard-shortcuts | repository,issues,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/_view_fragments/issues/show/gitpython-developers/GitPython/2064/issue_layout |
| twitter:image | https://opengraph.githubassets.com/9795d812d3a78785afb7c23c378dd6762c4717645d92a41fa6fc474d690d5d82/gitpython-developers/GitPython/issues/2064 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/9795d812d3a78785afb7c23c378dd6762c4717645d92a41fa6fc474d690d5d82/gitpython-developers/GitPython/issues/2064 |
| og:image:alt | Tags found in the packed-refs file that can be created by the Git command git pack-refs do not have to be UTF8 encoded. In these cases, GitPython fails to read these tags due to assuming they shoul... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | benmss |
| hostname | github.com |
| expected-hostname | github.com |
| None | 7b32f1c7c4549428ee399213e8345494fc55b5637195d3fc5f493657579235e8 |
| turbo-cache-control | no-preview |
| go-import | github.com/gitpython-developers/GitPython git https://github.com/gitpython-developers/GitPython.git |
| octolytics-dimension-user_id | 503709 |
| octolytics-dimension-user_login | gitpython-developers |
| octolytics-dimension-repository_id | 1126087 |
| octolytics-dimension-repository_nwo | gitpython-developers/GitPython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1126087 |
| octolytics-dimension-repository_network_root_nwo | gitpython-developers/GitPython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | bdde15ad1b403e23b08bbd89b53fbe6bdf688cad |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width