From a04fdc47dfbe66053046e7795b397916332b0ca9 Mon Sep 17 00:00:00 2001 From: milde Date: Fri, 25 Jan 2013 13:42:17 +0000 Subject: [PATCH] Fix TypeError: Python 3 does no implicit conversion between bytes and unicode string. git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@7596 929543f6-e4f2-0310-98a6-ba3bd3dd1d04 --- docutils/io.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docutils/io.py b/docutils/io.py index 80dced637..4e526302d 100644 --- a/docutils/io.py +++ b/docutils/io.py @@ -369,9 +369,9 @@ class FileOutput(Output): if ('b' not in self.mode and sys.version_info < (3,0) or check_encoding(self.destination, self.encoding) is False ): - data = self.encode(data) if sys.version_info >= (3,0) and os.linesep != '\n': data = data.replace('\n', os.linesep) # fix endings + data = self.encode(data) try: # In Python < 2.5, try...except has to be nested in try...finally. try: -- 2.11.4.GIT