raphaelm / python-sepaxml

SEPA Direct Debit XML generation in python
MIT License
110 stars 42 forks source link

Double escaping issues #4

Closed lutoma closed 7 years ago

lutoma commented 7 years ago

At least for some characters, there seem to be double escaping issues. For example, setting name in a payment to Test & Test results in <Nm>Test &amp;amp; Test</Nm>.

The issue seems to be these: https://github.com/raphaelm/python-sepadd/blob/6fd06341b8fa2b0b4fef48ba0b5c410d8d80a707/sepadd/debit.py#L103

Removing the escape() around the assignments in debit.py fixes this issue and results in <Nm>Test &amp; Test</Nm>, so there already seems to be some builtin escaping going on. I'm just not sure if xml.sax.saxutils.escape maybe does some additional escaping that's required?

Using Python 3.6.2 and python-sepadd 1.1.0

raphaelm commented 7 years ago

Sorry for the late reply. This is already part of the original PySepaDD code, so nothing I've added and so I at least believe we can just remove it.