Skip to content

Timeout error message should be a bytes string #625

Closed

Description

@JoshData

At https://github.com/gitpython-developers/GitPython/blob/master/git/cmd.py#L650, I think the error message about timeouts should be a b"..." bytes string and not a regular string. You can see right afterwards in the endswith call that the string is expected to be a bytes string.

                        stderr_value = 'Timeout: the command "%s" did not complete in %d ' \
                                       'secs.' % (" ".join(command), kill_after_timeout)
                ....
                if stderr_value.endswith(b"\n"):
                    stderr_value = stderr_value[:-1]

So it should be:

                        stderr_value = b'Timeout: the command "%s" did not complete in %d ' \
                                       b'secs.' % (" ".join(command), kill_after_timeout)

Activity

  1. Byron commented on Jun 10, 2017

    @Byron
    Member

    @JoshData Thanks for letting me know. Would you like to contribute the fix?

  2. JoshData commented on Jun 13, 2017

    @JoshData
    Author

    Yes will do.

  3. JoshData commented on Dec 10, 2017

    @JoshData
    Author

    This was subsequently fixed by #682 in 1dbfd29. Thanks!

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions