Title: Impossible to clone to path with unicode · Issue #920 · gitpython-developers/GitPython · GitHub
Open Graph Title: Impossible to clone to path with unicode · Issue #920 · gitpython-developers/GitPython
X Title: Impossible to clone to path with unicode · Issue #920 · gitpython-developers/GitPython
Description: Hi, in integration of GitPython I ran into an issue with cloning into directories that have an unicode name. This was an issue with version 2.1.9 and has not been fixed with upgrade to 3.0.2. I am using Python 3.7. Basically, if you pass...
Open Graph Description: Hi, in integration of GitPython I ran into an issue with cloning into directories that have an unicode name. This was an issue with version 2.1.9 and has not been fixed with upgrade to 3.0.2. I am ...
X Description: Hi, in integration of GitPython I ran into an issue with cloning into directories that have an unicode name. This was an issue with version 2.1.9 and has not been fixed with upgrade to 3.0.2. I am ...
Opengraph URL: https://github.com/gitpython-developers/GitPython/issues/920
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Impossible to clone to path with unicode","articleBody":"Hi, in integration of GitPython I ran into an issue with cloning into directories that have an unicode name. This was an issue with version 2.1.9 and has not been fixed with upgrade to 3.0.2.\r\n\r\nI am using Python 3.7.\r\n\r\nBasically, if you pass a `str` with some unicode to e.g. `Repo.clone_from` than the package throws an `UnicodeEncodeError`, it seems in processing of the output of the command.\r\n\r\n```\r\n return Repo.clone_from(repo, repo_path, branch=branch, **kwargs)\r\nvenv/lib64/python3.7/site-packages/git/repo/base.py:1023: in clone_from\r\n return cls._clone(git, url, to_path, GitCmdObjectDB, progress, multi_options, **kwargs)\r\nvenv/lib64/python3.7/site-packages/git/repo/base.py:969: in _clone\r\n finalize_process(proc, stderr=stderr)\r\nvenv/lib64/python3.7/site-packages/git/util.py:333: in finalize_process\r\n proc.wait(**kwargs)\r\nvenv/lib64/python3.7/site-packages/git/cmd.py:399: in wait\r\n stderr = force_bytes(stderr)\r\n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \r\n\r\ndata = \"Cloning into '/tmp/arca/test/abčď/repos/_tmp_tmp1f9n_j71299f859f6fac750147aec65a9992f8e289ef42177ff1b234677764b2d5c61560/master'...\\n\", encoding = 'ascii'\r\n\r\n def force_bytes(data, encoding=\"ascii\"):\r\n if isinstance(data, bytes):\r\n return data\r\n \r\n if isinstance(data, string_types):\r\n> return data.encode(encoding)\r\nE UnicodeEncodeError: 'ascii' codec can't encode characters in position 31-32: ordinal not in range(128)\r\n```\r\n\r\nSince GitPython is Python 3+ only now, it would make make sense to set the default encoding in `force_bytes` to utf-8, that actually fixes the issue when I try it. This was proposed in https://github.com/gitpython-developers/gitdb/pull/48 and or https://github.com/gitpython-developers/gitdb/pull/49, but it's been a while since those have been proposed.\r\n\r\nMaybe an another solution would be for the use to be able to select the default encoding somehow, as not to break previous cases, but to provide a solution for this issue?\r\n\r\nThis is related to #761, which seems to be stale at the moment. I'm raising the issue again since it's still an problem in the new version of GitPython which is Python 3+. \r\n","author":{"url":"https://github.com/mikicz","@type":"Person","name":"mikicz"},"datePublished":"2019-09-12T13:07:47Z","url":"https://github.com/gitpython-developers/GitPython/issues/920"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| 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:8ca54fc9-d9d4-cdd1-3386-3eed6fa0cfc0 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8A7A:20F00E:7932EF:A1D553:6B00B011 |
| html-safe-nonce | a1988351915e4b03586771f4db184177f0884cc20004ca89b98215651d549452 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QTdBOjIwRjAwRTo3OTMyRUY6QTFENTUzOjZCMDBCMDExIiwidmlzaXRvcl9pZCI6Ijg3ODk3NDk5MzcxMjc2MDAxNDUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | d0fdacdbb8a1dbb9844f53cc1d93acc927f047a10efe7dc0fa5ad00541fbe40a |
| hovercard-subject-tag | issue:492794783 |
| 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/920/issue_layout |
| twitter:image | https://opengraph.githubassets.com/24d4e912eb2e1da943abfbdecdf78fb2dc6fb8ac468a631e1c50c4a0b0882072/gitpython-developers/GitPython/issues/920 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/24d4e912eb2e1da943abfbdecdf78fb2dc6fb8ac468a631e1c50c4a0b0882072/gitpython-developers/GitPython/issues/920 |
| og:image:alt | Hi, in integration of GitPython I ran into an issue with cloning into directories that have an unicode name. This was an issue with version 2.1.9 and has not been fixed with upgrade to 3.0.2. I am ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | mikicz |
| hostname | github.com |
| expected-hostname | github.com |
| None | c0dd5f5d6f515a591019ecd66df2c4eab3379c2d3b0777568a90d8c7ae10b79e |
| 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 | 729d8cda69b3d267995675dfbf89ff27ccf61bf6 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width