Title: Error when handling non-ascii filename · Issue #1631 · gitpython-developers/GitPython · GitHub
Open Graph Title: Error when handling non-ascii filename · Issue #1631 · gitpython-developers/GitPython
X Title: Error when handling non-ascii filename · Issue #1631 · gitpython-developers/GitPython
Description: Steps to reproduce: $ mkdir foo $ cd foo $ git init $ touch 'bokm'$'\345''l.alias' $ python -c 'import git; git.Repo(".").untracked_files' Traceback (most recent call last): File "
Open Graph Description: Steps to reproduce: $ mkdir foo $ cd foo $ git init $ touch 'bokm'$'\345''l.alias' $ python -c 'import git; git.Repo(".").untracked_files' Traceback (most recent call last): File "
X Description: Steps to reproduce: $ mkdir foo $ cd foo $ git init $ touch 'bokm'$'\345''l.alias' $ python -c 'import git; git.Repo(".").untracked_files' Traceback (most ...
Opengraph URL: https://github.com/gitpython-developers/GitPython/issues/1631
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Error when handling non-ascii filename","articleBody":"Steps to reproduce:\r\n\r\n```\r\n$ mkdir foo\r\n$ cd foo\r\n$ git init\r\n$ touch 'bokm'$'\\345''l.alias'\r\n$ python -c 'import git; git.Repo(\".\").untracked_files'\r\nTraceback (most recent call last):\r\n File \"\u003cstring\u003e\", line 1, in \u003cmodule\u003e\r\n File \"/usr/lib/python3.11/site-packages/git/repo/base.py\", line 839, in untracked_files\r\n return self._get_untracked_files()\r\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n File \"/usr/lib/python3.11/site-packages/git/repo/base.py\", line 856, in _get_untracked_files\r\n filename = filename.encode(\"ascii\").decode(\"unicode_escape\").encode(\"latin1\").decode(defenc)\r\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\nUnicodeDecodeError: 'utf-8' codec can't decode byte 0xe5 in position 4: invalid continuation byte\r\n```\r\n\r\nI can reproduce with 3.1.30 and 3.1.32.\r\n\r\nA file with such name is present in ftp://ftp.gnu.org/gnu/aspell/dict/nb/aspell-nb-0.50.1-0.tar.bz2\r\nI'm not sure what encoding it's supposed to be. Firefox detects it as windows-1252 (and displays it correctly).","author":{"url":"https://github.com/lubomir","@type":"Person","name":"lubomir"},"datePublished":"2023-08-22T12:55:17.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/1631/GitPython/issues/1631"}
| 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:dd7b5362-7bd1-9742-7a78-2816a2431249 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C2BA:21A6DB:169ADE3:20484F8:6969069A |
| html-safe-nonce | 86487261fd4c37549302816625117fb7f5df9bb418eee07dcf0b6dabb0672705 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMkJBOjIxQTZEQjoxNjlBREUzOjIwNDg0Rjg6Njk2OTA2OUEiLCJ2aXNpdG9yX2lkIjoiNjQwOTE1NDY4NDI1MjY1MzIxMCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | c1eb302027d91bcb25b6c50a43345326346ca47863be1aa628905aab60448d5f |
| hovercard-subject-tag | issue:1861407474 |
| 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/1631/issue_layout |
| twitter:image | https://opengraph.githubassets.com/6d39a59ed8feb077a0f1a0029b8025298f1dd925989ddd732a48dbbf1491a63e/gitpython-developers/GitPython/issues/1631 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/6d39a59ed8feb077a0f1a0029b8025298f1dd925989ddd732a48dbbf1491a63e/gitpython-developers/GitPython/issues/1631 |
| og:image:alt | Steps to reproduce: $ mkdir foo $ cd foo $ git init $ touch 'bokm'$'\345''l.alias' $ python -c 'import git; git.Repo(".").untracked_files' Traceback (most recent call last): File " |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | lubomir |
| hostname | github.com |
| expected-hostname | github.com |
| None | e6156bd4ef9f2dc8dadf4c49a8f7ed8532186388cef72eda3ccb9f0ab3b8cfca |
| 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 | ee2210c3e58153aae53400c942f8a7b4bbb43ec4 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width