From 5f5f9177906c05f7d9049fc6456e1386537edabc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Neuh=C3=A4user?= Date: Wed, 16 Jun 2010 23:05:56 +0200 Subject: [PATCH] only decode if possible --- sphinx/environment.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sphinx/environment.py b/sphinx/environment.py index 6ad28ec8a..bf255165e 100644 --- a/sphinx/environment.py +++ b/sphinx/environment.py @@ -630,6 +630,8 @@ class BuildEnvironment: class SphinxSourceClass(FileInput): def decode(self_, data): + if isinstance(data, unicode): + return data return data.decode(self_.encoding, 'sphinx') def read(self_):