A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/gitpython-developers/GitPython/issues/1220 below:

GitCommand errors are stringifying bytes in 3.1.15 · Issue #1220 · gitpython-developers/GitPython · GitHub

The 3.1.15 release changed at least how git.exc.GitCommandError Errors are being generated. I have tested with stderr, but am guessing the same would be true for stdout. Previously git.exc.GitCommandError.stderr was a string of the error with bytes decoded, now the error is a string with bytes stringified.

repo.git.rebase Error:

remote.push Error:

Steps to reproduce:

import git

exception = git.exc.CommandError(command="git rebase invalid_branch".split(), stderr=b"abc")
exception.stderr

Steps to reproduce from code

import git

path_to_repo = "my_project"
repo = git.Repo(path_to_repo)

local_branch = "invalid_branch"
remote_branch = local_branch

# Generate Error for Rebase
try:
    repo.git.rebase(refspec=f"{remote_branch})"
except Exception as err:
    print(err.stderr)

# Generate Error for Push
try:
    repo.remotes[0].push(f"{local_branch}:{remote_branch}")
except Exception as err:
    print(err.stderr)

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4