diff options
author | Thomas Waldmann <tw@waldmann-edv.de> | 2016-08-15 15:52:19 +0200 |
---|---|---|
committer | Thomas Waldmann <tw@waldmann-edv.de> | 2016-08-15 15:52:19 +0200 |
commit | 3c8d86354b4215d7f48b9c367f75a50299fcd2eb (patch) | |
tree | 3414c2169e26b910d5bcd09fd7c618835ca074f1 /src | |
parent | 1f056d9e8ab54066a9242cde7d89c83f2fd6c1dd (diff) |
src cleanup: get rid of text-as-bytes in borg.remote
Diffstat (limited to 'src')
-rw-r--r-- | src/borg/remote.py | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/borg/remote.py b/src/borg/remote.py index ff057b7b0..18637cae7 100644 --- a/src/borg/remote.py +++ b/src/borg/remote.py @@ -283,22 +283,23 @@ This problem will go away as soon as the server has been upgraded to 1.0.7+. return msgid def handle_error(error, res): - if error == b'DoesNotExist': + error = error.decode('utf-8') + if error == 'DoesNotExist': raise Repository.DoesNotExist(self.location.orig) - elif error == b'AlreadyExists': + elif error == 'AlreadyExists': raise Repository.AlreadyExists(self.location.orig) - elif error == b'CheckNeeded': + elif error == 'CheckNeeded': raise Repository.CheckNeeded(self.location.orig) - elif error == b'IntegrityError': + elif error == 'IntegrityError': raise IntegrityError(res) - elif error == b'PathNotAllowed': + elif error == 'PathNotAllowed': raise PathNotAllowed(*res) - elif error == b'ObjectNotFound': + elif error == 'ObjectNotFound': raise Repository.ObjectNotFound(res[0], self.location.orig) - elif error == b'InvalidRPCMethod': + elif error == 'InvalidRPCMethod': raise InvalidRPCMethod(*res) else: - raise self.RPCError(res.decode('utf-8'), error.decode('utf-8')) + raise self.RPCError(res.decode('utf-8'), error) calls = list(calls) waiting_for = [] |