From e11904f2794cc1fcd1a0367e4f019334ed0802fb Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Feb 13 2015 16:28:31 +0000 Subject: Fix the raw view by requiring the data to be bytes --- diff --git a/progit/ui/repo.py b/progit/ui/repo.py index 82dee91..fae9cb5 100644 --- a/progit/ui/repo.py +++ b/progit/ui/repo.py @@ -427,7 +427,7 @@ def view_raw_file(repo, identifier, filename=None, username=None): mimetype = 'text/plain' if mimetype.startswith('text/') and not encoding: - encoding = chardet.detect(data)['encoding'] + encoding = chardet.detect(bytes(data))['encoding'] headers = {'Content-Type': mimetype} if encoding: