From 028c832153030b600ccba9bc7165ca060b1c1212 Mon Sep 17 00:00:00 2001 From: Benny Malengier Date: Thu, 4 Apr 2013 10:13:36 +0000 Subject: [PATCH] 6590: gramps40 asciidoc.py crashes for at least some reports svn: r21874 --- gramps/plugins/docgen/asciidoc.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gramps/plugins/docgen/asciidoc.py b/gramps/plugins/docgen/asciidoc.py index b74964afa..37b435888 100644 --- a/gramps/plugins/docgen/asciidoc.py +++ b/gramps/plugins/docgen/asciidoc.py @@ -30,6 +30,7 @@ # python modules # #------------------------------------------------------------------------ +from __future__ import unicode_literals import io import sys #------------------------------------------------------------------------ @@ -50,7 +51,7 @@ from gramps.gen.plug.report import DocOptions # Constants # #------------------------------------------------------------------------ -LEFT,RIGHT,CENTER = 'LEFT','RIGHT','CENTER' +LEFT, RIGHT, CENTER = 'LEFT', 'RIGHT', 'CENTER' #------------------------------------------------------------------------ # @@ -63,7 +64,7 @@ LEFT,RIGHT,CENTER = 'LEFT','RIGHT','CENTER' # _relative_ to the "left" margin. It can be negative! # #------------------------------------------------------------------------ -def reformat_para(para='',left=0,right=72,just=LEFT,right_pad=0,first=0): +def reformat_para(para='', left=0, right=72, just=LEFT, right_pad=0, first=0): if not para.strip(): return "\n" @@ -158,7 +159,6 @@ class AsciiDoc(BaseDoc,TextDoc): try: self.f = io.open(self.filename,"w", - encoding='ascii', errors = 'backslashreplace') except Exception as msg: errmsg = "%s\n%s" % (_("Could not create %s") % self.filename, msg)