Skip to content

Timeout error message should be a bytes string #625

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

Closed
JoshData opened this issue May 6, 2017 · 3 comments
Closed

Timeout error message should be a bytes string #625

JoshData opened this issue May 6, 2017 · 3 comments

Comments

@JoshData
Copy link

JoshData commented May 6, 2017

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)
@Byron
Copy link
Member

Byron commented Jun 10, 2017

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

@JoshData
Copy link
Author

Yes will do.

@JoshData
Copy link
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
Development

No branches or pull requests

2 participants