mirror of
https://pagure.io/fm-orchestrator.git
synced 2026-04-24 10:43:16 +08:00
Fix the handling of modulemd files with unicode characters.
This commit introduces new to_text_type helper method and calls it for return value of all mmd.dumps() calls. That way, we always end up with proper unicode string represntation on both python major versions. This commit also adds unicode character to description of all the yaml files we use in the tests so we can be sure MBS can handle unicode characters properly. This might be temporary fix, depending on the result of discussion at https://github.com/fedora-modularity/libmodulemd/issues/184.
This commit is contained in:
@@ -29,6 +29,7 @@ import tempfile
|
||||
import os
|
||||
from multiprocessing.dummy import Pool as ThreadPool
|
||||
from datetime import datetime
|
||||
from module_build_service.utils import to_text_type
|
||||
|
||||
import kobo.rpmlib
|
||||
import requests
|
||||
@@ -562,7 +563,7 @@ def submit_module_build(username, url, mmd, optional_params=None):
|
||||
name=mmd.get_name(),
|
||||
stream=mmd.get_stream(),
|
||||
version=version_str,
|
||||
modulemd=mmd.dumps(),
|
||||
modulemd=to_text_type(mmd.dumps()),
|
||||
scmurl=url,
|
||||
username=username,
|
||||
**(optional_params or {})
|
||||
@@ -767,7 +768,7 @@ def load_local_builds(local_build_nsvs, session=None):
|
||||
stream=mmd.get_stream(),
|
||||
version=str(mmd.get_version()),
|
||||
context=mmd.get_context(),
|
||||
modulemd=mmd.dumps(),
|
||||
modulemd=to_text_type(mmd.dumps()),
|
||||
scmurl="",
|
||||
username="mbs",
|
||||
publish_msg=False)
|
||||
|
||||
Reference in New Issue
Block a user