From 3ed6b4dab9d8635c4e7616e2c135af683e29f768 Mon Sep 17 00:00:00 2001 From: Steven Walter Date: Sun, 1 Aug 2021 22:17:41 -0400 Subject: [PATCH] latex_invoices.py: write takes string not bytes write() fails if you give it bytes, so don't encode --- bindings/python/example_scripts/latex_invoices.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bindings/python/example_scripts/latex_invoices.py b/bindings/python/example_scripts/latex_invoices.py index 84fd5d216d..f494fb1318 100644 --- a/bindings/python/example_scripts/latex_invoices.py +++ b/bindings/python/example_scripts/latex_invoices.py @@ -160,7 +160,7 @@ def invoice_to_lco(invoice): n = ent.GetQuantity() uprice = locale.currency(price).rstrip(" EUR") - un = unicode( + un = str( int(float(n.num()) / n.denom()) ) # choose best way to format numbers according to locale @@ -288,7 +288,6 @@ def main(argv=None): # Opening output file f = open(output_file_name, "w") - lco_str = lco_str.encode("latin1") f.write(lco_str) f.close()