Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

insert_updateinfo() does not encode the unicode xml_dump, causing an encoding issue #955

Closed
bowlofeggs opened this issue Sep 21, 2016 · 0 comments

Comments

@bowlofeggs
Copy link
Member

commented Sep 21, 2016

The version of createrepo_c in EL 7 returns a string (byte array) from xml_dump(), but the version in Fedora 24 returns a unicode object. By default, Python 2.7 uses ascii encoding when asked to write() a unicode object to a file. This is failing in production, since our updateinfo has characters that don't have ascii code points.

The fix is easy! The call to self.uinfo.xml_dump() needs a .encode('utf-8') after it:

https://github.com/fedora-infra/bodhi/blob/2.2.0/bodhi/server/metadata.py#L281

@bowlofeggs bowlofeggs self-assigned this Sep 21, 2016

@bowlofeggs bowlofeggs removed the EasyFix label Sep 21, 2016

bowlofeggs added a commit to bowlofeggs/bodhi that referenced this issue Sep 22, 2016
puiterwijk added a commit that referenced this issue Sep 22, 2016
UTF-8 encode the updateinfo before writing
Fixes: #955
Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>
puiterwijk added a commit that referenced this issue Sep 22, 2016
UTF-8 encode the updateinfo before writing
Fixes: #955
Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>
puiterwijk added a commit that referenced this issue Sep 22, 2016
UTF-8 encode the updateinfo before writing
Fixes: #955
Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>
bowlofeggs added a commit to bowlofeggs/bodhi that referenced this issue Sep 22, 2016
UTF-8 encode the updateinfo before writing
Fixes: fedora-infra#955
Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>
amolkahat added a commit to amolkahat/bodhi that referenced this issue Feb 2, 2017
UTF-8 encode the updateinfo before writing
Fixes: fedora-infra#955
Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.