diff --git a/git_review/cmd.py b/git_review/cmd.py index 19adfae2..f60bea71 100644 --- a/git_review/cmd.py +++ b/git_review/cmd.py @@ -171,7 +171,7 @@ def git_credentials(url): """Return credentials using git credential or None.""" cmd = 'git', 'credential', 'fill' stdin = 'url=%s' % url - rc, out = run_command_status(*cmd, stdin=stdin.encode('utf-8')) + rc, out = run_command_status(*cmd, stdin=stdin) if rc: return None data = dict(line.split('=', 1) for line in out.splitlines()) diff --git a/git_review/tests/test_unit.py b/git_review/tests/test_unit.py index 0854ebc7..9e201536 100644 --- a/git_review/tests/test_unit.py +++ b/git_review/tests/test_unit.py @@ -305,7 +305,7 @@ class GitReviewUnitTest(testtools.TestCase): # This gets encoded to utf8 which means the type passed down # is bytes. mock_run.assert_called_once_with('git', 'credential', 'fill', - stdin=b'url=%s' % url.encode('utf-8')) + stdin='url=%s' % url) calls = [mock.call(url), mock.call(url, auth=('user', 'pass'))] mock_get.assert_has_calls(calls) @@ -323,7 +323,7 @@ class GitReviewUnitTest(testtools.TestCase): # This gets encoded to utf8 which means the type passed down # is bytes. mock_run.assert_called_once_with('git', 'credential', 'fill', - stdin=b'url=%s' % url.encode('utf-8')) + stdin='url=%s' % url) calls = [mock.call(url), mock.call(url, auth=('user', 'pass'))] mock_get.assert_has_calls(calls) @@ -341,7 +341,7 @@ class GitReviewUnitTest(testtools.TestCase): # This gets encoded to utf8 which means the type passed down # is bytes. mock_run.assert_called_once_with('git', 'credential', 'fill', - stdin=b'url=%s' % url.encode('utf-8')) + stdin='url=%s' % url) mock_get.assert_called_once_with(url) @mock.patch('sys.argv', ['argv0', '--track', 'branch']) diff --git a/test-requirements.txt b/test-requirements.txt index 19da82ed..ad03fc16 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,5 +1,5 @@ hacking>=2.0.0,<2.1.0 mock fixtures>=0.3.14 -stestr>=2.2.0 +stestr>=2.2.0,<3.0.0 testtools>=0.9.34