tarantool / mkrepo

Maintain DEB and RPM repositories on S3
70 stars 24 forks source link

rpm: escape special characters in XML #68

Closed ylobankov closed 2 years ago

ylobankov commented 2 years ago

This patch makes special XML characters be escaped in the provides, requires, and obsoletes sections to avoid the following error:

xml.etree.ElementTree.ParseError: not well-formed (invalid token)

Note, commit c8ca21f7 (rpm: fix xml.etree.ElementTree.ParseError issue) fixed the same issue but for the license section only.

Follows up #66

ylobankov commented 2 years ago

Seems logical for me.

A few questions:

  1. Aren't you mind to add a unit test?
  2. Can you share a situation, where you met the problem? It is interesting to look at real valid values that requires escaping.
  1. No, I wanted to add it anywhere.
  2. Please take a look at https://github.com/tarantool/mkrepo/pull/68/files#diff-75228f651a1ac4e8207c1e1405f39af281db4c9363cf0ba7ef7711859a56419cR257. I took a real case as a base for the unit test.