From aa1b5a69dc700f27398e0a09143c0ba928359dae Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Wed, 13 Nov 2019 10:41:56 +0100 Subject: [PATCH] [FIX] bug in generate_facturx_from_file() when using argument additional_attachments Bump version to 1.5 --- README.rst | 6 +++++- facturx/_version.py | 2 +- facturx/facturx.py | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/README.rst b/README.rst index a16c05f..309fe29 100644 --- a/README.rst +++ b/README.rst @@ -65,9 +65,13 @@ Contributors Changelog ========= +* Version 1.5 dated 2019-11-13 + + * Fix bug in generate_facturx_from_file() when using argument additional_attachments + * Version 1.4 dated 2019-07-24 - * Update Factur-X XSD to the final version of Factur-X v1.0.4 + * Update Factur-X XSD to the final version of Factur-X v1.0.04 * Support XML extraction with ZUGFeRD invoices using 'zugferd-invoice.xml' filename (instead of the filename 'ZUGFeRD-invoice.xml' specified by the standard) * Version 1.3 dated 2019-06-12 diff --git a/facturx/_version.py b/facturx/_version.py index 0f66308..fcb6b5d 100644 --- a/facturx/_version.py +++ b/facturx/_version.py @@ -1 +1 @@ -__version__ = '1.4' +__version__ = '1.5' diff --git a/facturx/facturx.py b/facturx/facturx.py index 157fa68..b603ed7 100644 --- a/facturx/facturx.py +++ b/facturx/facturx.py @@ -837,7 +837,7 @@ def generate_facturx_from_file( filename = os.path.basename(attach_filepath) mod_timestamp = os.path.getmtime(attach_filepath) mod_dt = datetime.fromtimestamp(mod_timestamp) - with open(attach_filepath, 'r') as fa: + with open(attach_filepath, 'rb') as fa: fa.seek(0) additional_attachments_read[fa.read()] = { 'filename': filename,