From 369300b7f9c815a4c56b5fbc896cb864a136c5a9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andr=C3=A9=20Wobst?= Date: Sat, 13 Feb 2016 00:05:47 +0000 Subject: [PATCH] improve error handling when input cannot be encoded by texenc git-svn-id: http://svn.code.sf.net/p/pyx/code/trunk/pyx@3674 a4f5e268-e194-4f32-bce1-d30804cbbcc5 --- CHANGES | 4 ++++ pyx/text.py | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/CHANGES b/CHANGES index d103afae..d8f885f8 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,7 @@ +0.15 (2016/xx/xx): + - text module: + - improve error handling when input cannot be encoded by texenc + 0.14.1 (2015/11/02): - distribution: - upload to PyPI (including old releases) diff --git a/pyx/text.py b/pyx/text.py index 687228a3..b153142a 100644 --- a/pyx/text.py +++ b/pyx/text.py @@ -1064,6 +1064,12 @@ class SingleRunner: self.texoutput.expect(None) self.texinput.write(expr) else: + + # test to encode expr early to not pile up expected results + # if the expression won't make it to the texinput at all + # (which would otherwise harm a proper cleanup) + expr.encode(self.texenc) + if oldstate == newstate == STATE_TYPESET: self.page += 1 expr = "\\ProcessPyXBox{%s%%\n}{%i}" % (expr, self.page) -- 2.11.4.GIT