libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From uty <>
Subject [GitHub] libcloud pull request #1069: Fix "Failed to parse XML" error when XML contai...
Date Wed, 14 Jun 2017 13:34:59 GMT
GitHub user uty opened a pull request:

    Fix "Failed to parse XML" error when XML contains wrong encoding declaration

    ## Fix "Failed to parse XML" error when XML contains wrong encoding declaration
    ### Description
    `lxml` fails to parse XML unicode string if latter contains encoding declaration. It raises
`ValueError: Unicode strings with encoding declaration are not supported. Please use bytes
input or XML fragments without declaration.` which was completely obstructed by reraise of
    This was already partially fixed in `libcloud.common.base.XmlResponse.parse_body()`, however
some subclasses had this method overwritten, or were not using it.
    ### Status
    - done, ready for review
    ### Checklist (tick everything that applies)
    - [x] [Code linting](
(required, can be done after the PR checks)
    - [ ] Documentation
    - [x] [Tests](
    - [ ] [ICLA](
(required for bigger changes)

You can merge this pull request into a Git repository by running:

    $ git pull for-upstream/lying_xml_encoding

Alternatively you can review and apply these changes as the patch at:

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1069
commit 4ff64a2755f35da41c509eff994b78b363de493f
Author: Hennadii Stas <>
Date:   2017-06-07T13:26:32Z

    FAM-903 encode xml responses on ec2 and openstack before passing them to xml parser

commit 28d1eb0938c5005025056588dd304b34ae8b515a
Author: Hennadii Stas <>
Date:   2017-06-09T12:37:36Z

    unint tests added


If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at or file a JIRA ticket
with INFRA.

View raw message