Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

invalid literal for int() with base 10: 'x' when diffing commits #1483

Open
bobeatslollipop opened this issue Aug 25, 2022 · 2 comments
Open

Comments

@bobeatslollipop
Copy link

bobeatslollipop commented Aug 25, 2022

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/git/cmd.py", line 114, in pump_stream
    handler(line)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/git/diff.py", line 570, in <lambda>
    handle_process_output(proc, lambda byt: cls._handle_diff_line(byt, repo, index),
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/git/diff.py", line 557, in _handle_diff_line
python-BaseException
    diff = Diff(repo, a_path, b_path, a_blob_id, b_blob_id, old_mode, new_mode,
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/git/diff.py", line 303, in __init__
    self.a_mode = mode_str_to_int(a_mode) if a_mode else None
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/git/objects/util.py", line 80, in mode_str_to_int
    mode += int(char) << iteration * 3
ValueError: invalid literal for int() with base 10: 'x'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/threading.py", line 946, in run
    self._target(*self._args, **self._kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/git/cmd.py", line 120, in pump_stream
    raise CommandError([f'<{name}-pump>'] + remove_password_if_present(cmdline), ex) from ex
git.exc.CommandError: Cmd('<stdout-pump>') failed due to: ValueError('invalid literal for int() with base 10: 'x'')
  cmdline: <stdout-pump> git diff-tree 81a1f0c4f84aeb6ee97edea64251419515eff571 8c38dfe86157463d745c453d9a1d8c066cc9b7c5 -r --abbrev=40 --full-index -M --raw -z --no-color

This is my first time posting an issue, so please tell me what extra information is needed!

@Byron
Copy link
Member

Byron commented Aug 26, 2022

It couldn't parse the output of this command:

git diff-tree 81a1f0c4f84aeb6ee97edea64251419515eff571 8c38dfe86157463d745c453d9a1d8c066cc9b7c5 -r --abbrev=40 --full-index -M --raw -z --no-color

If executed by hand, it should yield the output which ideally is posted here. That way it should become clear why it tries to parse x as integer.

@Byron Byron changed the title Problem when using Diff invalid literal for int() with base 10: 'x' when diffing commits Aug 26, 2022
@langfield
Copy link
Contributor

This was fixed by #1491.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants