1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-11-10 06:46:15 +01:00

Revert "Catch non-utf8 and convert it to utf8 inside create_submit_request() to prevent"

This reverts commit 518229067c.
Doesn't solve your issue:

    >>> unicode("!§").encode("utf8")
    UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 1: ordinal not in range(128)

Fix pending...
This commit is contained in:
Sascha Peilicke 2011-03-04 08:59:05 +01:00
parent 518229067c
commit 95bc493b19

View File

@ -3467,16 +3467,6 @@ def create_submit_request(apiurl,
message=None, orev=None, src_update=None):
import cgi
try:
unicode(message).decode('utf-8')
except:
# UnicodeDecodeError: 'utf8' codec can't decode bytes in position 365-367: invalid data
# If it was not valid utf-8, we assume it was some latin-X, which needs to be
# encoded in utf-8, before it goes into XML.
# FIXME: Should this be handled earlier? Are there more places?
message = unicode(message).encode('utf-8')
options_block=""
if src_update:
options_block="""<options><sourceupdate>%s</sourceupdate></options> """ % (src_update)