Skip to content

Commit

Permalink
Fix tests on python3.
Browse files Browse the repository at this point in the history
  • Loading branch information
jelmer committed Apr 8, 2018
1 parent a463b77 commit bfed8f7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion dulwich/objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -1015,7 +1015,9 @@ def check(self):
True):
check_hexsha(sha, 'invalid sha %s' % sha)
if b'/' in name or name in (b'', b'.', b'..', b'.git'):
raise ObjectFormatException('invalid name %s' % name)
raise ObjectFormatException(
'invalid name %s' %
name.decode('utf-8', 'replace'))

if mode not in allowed_modes:
raise ObjectFormatException('invalid mode %06o' % mode)
Expand Down
2 changes: 1 addition & 1 deletion dulwich/tests/test_porcelain.py
Original file line number Diff line number Diff line change
Expand Up @@ -1304,7 +1304,7 @@ def test_none(self):
def test_git_dir(self):
obj = Tree()
a = Blob()
a.data = "foo"
a.data = b"foo"
obj.add(b".git", 0o100644, a.id)
self.repo.object_store.add_objects(
[(a, None), (obj, None)])
Expand Down

0 comments on commit bfed8f7

Please sign in to comment.