Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id AB50B200CA7 for ; Wed, 14 Jun 2017 15:35:00 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id A9CF7160BDB; Wed, 14 Jun 2017 13:35:00 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id F051A160BC0 for ; Wed, 14 Jun 2017 15:34:59 +0200 (CEST) Received: (qmail 9206 invoked by uid 500); 14 Jun 2017 13:34:59 -0000 Mailing-List: contact notifications-help@libcloud.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@libcloud.apache.org Delivered-To: mailing list notifications@libcloud.apache.org Received: (qmail 9197 invoked by uid 99); 14 Jun 2017 13:34:59 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 14 Jun 2017 13:34:59 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 1525DDFAF5; Wed, 14 Jun 2017 13:34:59 +0000 (UTC) From: uty To: notifications@libcloud.apache.org Reply-To: notifications@libcloud.apache.org Message-ID: Subject: [GitHub] libcloud pull request #1069: Fix "Failed to parse XML" error when XML contai... Content-Type: text/plain Date: Wed, 14 Jun 2017 13:34:59 +0000 (UTC) archived-at: Wed, 14 Jun 2017 13:35:00 -0000 GitHub user uty opened a pull request: https://github.com/apache/libcloud/pull/1069 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 `MalformedResponseError`. 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](http://libcloud.readthedocs.org/en/latest/development.html#code-style-guide) (required, can be done after the PR checks) - [ ] Documentation - [x] [Tests](http://libcloud.readthedocs.org/en/latest/testing.html) - [ ] [ICLA](http://libcloud.readthedocs.org/en/latest/development.html#contributing-bigger-changes) (required for bigger changes) You can merge this pull request into a Git repository by running: $ git pull https://github.com/Scalr/libcloud for-upstream/lying_xml_encoding Alternatively you can review and apply these changes as the patch at: https://github.com/apache/libcloud/pull/1069.patch 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 infrastructure@apache.org or file a JIRA ticket with INFRA. ---