From 8f3dbba8592c589d8444364155e672c382d64a13 Mon Sep 17 00:00:00 2001 From: Raphael Michel Date: Mon, 3 Aug 2020 18:18:23 +0200 Subject: [PATCH] PDF renderer: Fail silently if bidirectional string handling failes --- src/pretix/base/pdf.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pretix/base/pdf.py b/src/pretix/base/pdf.py index d4813fee15..3572f5dad2 100644 --- a/src/pretix/base/pdf.py +++ b/src/pretix/base/pdf.py @@ -492,7 +492,10 @@ class Renderer: 'support_ligatures': False, } reshaper = ArabicReshaper(configuration=configuration) - text = "
".join(get_display(reshaper.reshape(l)) for l in text.split("
")) + try: + text = "
".join(get_display(reshaper.reshape(l)) for l in text.split("
")) + except: + logger.exception('Reshaping/Bidi fixes failed on string {}'.format(repr(text))) p = Paragraph(text, style=style) w, h = p.wrapOn(canvas, float(o['width']) * mm, 1000 * mm)