=== modified file 'breezy/git/remote.py'
--- old/breezy/git/remote.py	2020-06-01 22:48:28 +0000
+++ new/breezy/git/remote.py	2020-11-08 02:42:27 +0000
@@ -232,11 +232,13 @@
         return e
     interesting_lines = [
         line for line in stderr_lines
-        if line and line.replace('=', '')]
+        if line and line.replace(b'=', b'')]
     if len(interesting_lines) == 1:
         interesting_line = interesting_lines[0]
-        return parse_git_error(url, interesting_line)
-    return RemoteGitError('\n'.join(stderr_lines))
+        return parse_git_error(
+            url, interesting_line.decode('utf-8', 'surrogateescape'))
+    return RemoteGitError(
+        b'\n'.join(stderr_lines).decode('utf-8', 'surrogateescape'))
 
 
 class GitSmartTransport(Transport):

=== modified file 'breezy/git/tests/test_remote.py'
--- old/breezy/git/tests/test_remote.py	2020-06-01 22:48:28 +0000
+++ new/breezy/git/tests/test_remote.py	2020-11-08 02:42:27 +0000
@@ -151,7 +151,7 @@
     def setUp(self):
         super(ParseHangupTests, self).setUp()
         try:
-            HangupException(['foo'])
+            HangupException([b'foo'])
         except TypeError:
             self.skipTest('dulwich version too old')
 
@@ -162,18 +162,18 @@
     def test_single_line(self):
         self.assertEqual(
             RemoteGitError('foo bar'),
-            parse_git_hangup('http://', HangupException(['foo bar'])))
+            parse_git_hangup('http://', HangupException([b'foo bar'])))
 
     def test_multi_lines(self):
         self.assertEqual(
             RemoteGitError('foo bar\nbla bla'),
             parse_git_hangup(
-                'http://', HangupException(['foo bar', 'bla bla'])))
+                'http://', HangupException([b'foo bar', b'bla bla'])))
 
     def test_filter_boring(self):
         self.assertEqual(
             RemoteGitError('foo bar'), parse_git_hangup('http://', HangupException(
-                ['=======', 'foo bar', '======'])))
+                [b'=======', b'foo bar', b'======'])))
 
     def test_permission_denied(self):
         self.assertEqual(
@@ -181,8 +181,8 @@
             parse_git_hangup(
                 'http://',
                 HangupException(
-                    ['=======',
-                     'You are not allowed to push code to this project.', '', '======'])))
+                    [b'=======',
+                     b'You are not allowed to push code to this project.', b'', b'======'])))
 
 
 class TestRemoteGitBranchFormat(TestCase):

