tarantool / mkrepo

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

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

Closed urbanchef closed 1 year ago

urbanchef commented 1 year ago

The license XML tag may contain an ampersand character that should be escaped, otherwise, it leads to the following error:

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

As a result, it renders repository unusable. This patch fixes the issue by escaping the fmt['license'] value in the dump_primary function.

Example:

<rpm:license>OpenSSL & Chromium CLA</rpm:license>      <-- before
<rpm:license>OpenSSL &amp; Chromium CLA</rpm:license>  <-- after
ylobankov commented 1 year ago

Thanks for the fix! Please form the commit message properly:

  1. Use the 50/72 rule for the commit message (50 chars for the subject, 72 chars for each line in the description).
  2. Please describe you changes in the commit message like you do in the PR description.