From 2b03edc6126c6d78c151c1b2d3b27d32ba287f51 Mon Sep 17 00:00:00 2001 From: Danimar Ribeiro Date: Wed, 3 Jan 2024 19:10:44 -0300 Subject: [PATCH 1/3] Escape the text used in the observations --- pytrustnfe/nfe/danfe.py | 3 ++- setup.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pytrustnfe/nfe/danfe.py b/pytrustnfe/nfe/danfe.py index 3d5d251b..93b89ba8 100644 --- a/pytrustnfe/nfe/danfe.py +++ b/pytrustnfe/nfe/danfe.py @@ -7,6 +7,7 @@ from io import BytesIO from textwrap import wrap import math +from html import escape from decimal import Decimal from reportlab.lib import utils @@ -1051,7 +1052,7 @@ def adicionais(self, oXML=None, tamanho_diminuir=0): observacoes = tagtext(oNode=el_infAdic, cTag="infCpl") if fisco: observacoes = fisco + " " + observacoes - P = Paragraph(observacoes, styles["Normal"]) + P = Paragraph(escape(observacoes), styles["Normal"]) w, h = P.wrap(128 * mm, 32 * mm) altura = (self.height - self.nlin - 5) * mm P.drawOn(self.canvas, (self.nLeft + 1) * mm, altura - h) diff --git a/setup.py b/setup.py index 911c7281..d591be8b 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from setuptools import setup, find_packages -VERSION = "2.0.1" +VERSION = "2.0.2" setup( From 9315556c8bcc8871e81432f03d9110d5b9d1619f Mon Sep 17 00:00:00 2001 From: Danimar Ribeiro Date: Wed, 3 Jan 2024 19:28:30 -0300 Subject: [PATCH 2/3] Trying to fix pyopenssl --- requirements.txt | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index c2c385c9..e07f6554 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,7 +2,7 @@ signxml==2.9.0 ; python_version < '3.7' signxml ; python_version >= '3.7' lxml >= 4.2.1 -cryptography >= 3.4.8 +cryptography >= 3.4.8, <= 23.2.0 pyOpenSSL >= 22.1.0 certifi >= 2018.1.18 diff --git a/setup.py b/setup.py index d591be8b..f6ae644d 100644 --- a/setup.py +++ b/setup.py @@ -53,7 +53,7 @@ 'xmlsec >= 1.3.13', # apt update;apt install libxmlsec1-dev pkg-config -y 'lxml >= 4.2.1', 'cryptography >= 3.4.8', - 'pyOpenSSL >= 17.5.0', + 'pyOpenSSL >= 17.5.0 <= 23.2.0', 'certifi >= 2018.1.18', 'urllib3', 'Jinja2', From d95a466a81ba02b97a71ed17e426c2863d4e7bf7 Mon Sep 17 00:00:00 2001 From: Danimar Ribeiro Date: Thu, 4 Jan 2024 15:33:31 -0300 Subject: [PATCH 3/3] Fix the openssl version --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index f6ae644d..3dbad6fe 100644 --- a/setup.py +++ b/setup.py @@ -53,7 +53,7 @@ 'xmlsec >= 1.3.13', # apt update;apt install libxmlsec1-dev pkg-config -y 'lxml >= 4.2.1', 'cryptography >= 3.4.8', - 'pyOpenSSL >= 17.5.0 <= 23.2.0', + 'pyOpenSSL >= 17.5.0, <= 23.2.0', 'certifi >= 2018.1.18', 'urllib3', 'Jinja2',