forked from openSUSE/osc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'handle-string-conversion' of https://github.com/krig/osc
Add core.parse_meta_to_string helper to work around the insane implementation of core.meta_exists. Since core.meta_exists may return a list of bytes, a str, a list of str etc., we ultimately convert the data to str before passing it ET.fromstring(...). In case of bytes, the explicit decoding is OK because it is assumed to be a valid utf-8 encoding (the data represents an xml). Note: at the moment core.parse_meta_to_string is also called even if it is not necessary (it is only necessary if the "create" parameter of a corresponding core.meta_exists call is True). Note 2: this is just a temporary workaround and, eventually, we will make the implementation of core.meta_exists more reasonable. When doing so, we will also remove "public" function core.parse_meta_to_string again. (Yes, this breaks API but the core.meta_exists change will also break the API in some sense - so that's OK.)
- Loading branch information
Showing
2 changed files
with
21 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters