Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix bug where colons in paths raise aValueError ondiff() calls.#1491

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Byron merged 1 commit intogitpython-developers:mainfromlangfield:main
Sep 14, 2022
Merged

Conversation

langfield
Copy link
Contributor

This commit introduces a potential fix for#1490 and#1483, in which aninvalid literal for int() with base 10: 'n' exception was raised within a diff operation. Within_handle_diff_line(), we split the output ofgit diff-tree on colons (: characters), under the assumption that there are no colons within the paths of the files being diffed. On POSIX systems this is not a valid assumption. The fix is to split on\x00:, since a null character always precedes the colons we actually need to split on.

A test already existed for this case (test_diff_file_with_colon()), but it was marked as skipped.

  • Split on\x00: instead of: in_handle_diff_line().
  • Unskiptest_diff_file_with_colon().

@langfieldlangfield changed the titleFix bug where colons in paths raise aValueError ondiff() calls.WIP: Fix bug where colons in paths raise aValueError ondiff() calls.Sep 12, 2022
@ByronByron marked this pull request as draftSeptember 12, 2022 23:08
This commit introduces a potential fix for#1490 and#1483, in which an`invalid literal for int() with base 10: 'n'` exception was raisedwithin a diff operation. Within `_handle_diff_line()`, we split theoutput of `git diff-tree` on colons (`:` characters), under theassumption that there are no colons within the paths of the files beingdiffed. On POSIX systems this is not a valid assumption. The fix is tosplit on `\x00:`, since a null character always precedes the colons weactually need to split on.A test already existed for this case (`test_diff_file_with_colon()`),but it was marked as skipped.* Split on `\x00:` instead of `:` in `_handle_diff_line()`.* Unskip `test_diff_file_with_colon()`.
@langfieldlangfield changed the titleWIP: Fix bug where colons in paths raise aValueError ondiff() calls.Fix bug where colons in paths raise aValueError ondiff() calls.Sep 13, 2022
@langfieldlangfield marked this pull request as ready for reviewSeptember 13, 2022 02:21
@ByronByron added this to thev3.1.28 - Bugfixes milestoneSep 14, 2022
@Byron
Copy link
Member

Thanks a lot! Amazing to see how close this issue was to a resolution all the time, and I am glad it's finally here now!

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
@langfield@Byron

[8]ページ先頭

©2009-2025 Movatter.jp