Title: Store raw path bytes in Diff instances by nvie · Pull Request #474 · gitpython-developers/GitPython · GitHub
Open Graph Title: Store raw path bytes in Diff instances by nvie · Pull Request #474 · gitpython-developers/GitPython
X Title: Store raw path bytes in Diff instances by nvie · Pull Request #474 · gitpython-developers/GitPython
Description: Previously, the following fields on Diff instances were assumed to be passed in as unicode strings: a_path b_path rename_from rename_to However, since Git natively records paths as bytes, these may potentially not have a valid unicode representation. This patch changes the Diff instance to instead take the following equivalent fields that should be raw bytes instead: a_rawpath b_rawpath raw_rename_from raw_rename_to NOTE ON BACKWARD COMPATIBILITY: The original a_path, b_path, etc. fields are still available as properties (rather than slots). These properties now dynamically decode the raw bytes into a unicode string (performing the potentially destructive operation of replacing invalid unicode chars by "�"'s). This means that all code using Diffs should remain backward compatible. The only exception is when people would manually construct Diff instances by calling the constructor directly, in which case they should now pass in bytes rather than unicode strings. See also the discussion on #467
Open Graph Description: Previously, the following fields on Diff instances were assumed to be passed in as unicode strings: a_path b_path rename_from rename_to However, since Git natively records paths as bytes, these m...
X Description: Previously, the following fields on Diff instances were assumed to be passed in as unicode strings: a_path b_path rename_from rename_to However, since Git natively records paths as bytes, these m...
Opengraph URL: https://github.com/gitpython-developers/GitPython/pull/474
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/checks(.:format) |
| route-controller | pull_requests |
| route-action | checks |
| fetch-nonce | v2:7170ab64-3e1b-8a05-2d87-ba710c8cc245 |
| current-catalog-service-hash | 87dc3bc62d9b466312751bfd5f889726f4f1337bdff4e8be7da7c93d6c00a25a |
| request-id | CD02:14FC13:29EDCA2:373521E:696B2F53 |
| html-safe-nonce | 1cb86487412bc959b88c6d71f2ae83cc79ebcfd1576b5421fabdb8fdcd725693 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDRDAyOjE0RkMxMzoyOUVEQ0EyOjM3MzUyMUU6Njk2QjJGNTMiLCJ2aXNpdG9yX2lkIjoiMzkyNDYyMzM4NzUwNDg4MTQ5MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 2cc49a65b36b8a1ee57cfbc61ab443f7f20338b2eb5db14907d1e6a1b977bcff |
| hovercard-subject-tag | pull_request:73814281 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,checks,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/GitPython/pull/474/checks |
| twitter:image | https://avatars.githubusercontent.com/u/83844?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/83844?s=400&v=4 |
| og:image:alt | Previously, the following fields on Diff instances were assumed to be passed in as unicode strings: a_path b_path rename_from rename_to However, since Git natively records paths as bytes, these m... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5f99f7c1d70f01da5b93e5ca90303359738944d8ab470e396496262c66e60b8d |
| 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 full-width full-width-p-0 |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 82560a55c6b2054555076f46e683151ee28a19bc |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width