You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by GitBox <gi...@apache.org> on 2019/07/23 10:27:03 UTC
[GitHub] [libcloud] charlesyc opened a new issue #1322:
list_container_objects doesn't work for Azure blob storage under python 2.7.5
charlesyc opened a new issue #1322: list_container_objects doesn't work for Azure blob storage under python 2.7.5
URL: https://github.com/apache/libcloud/issues/1322
## Summary
`list_container_objects` doesn't work for Azure blob storage under python 2.7.5
## Detailed Information
###libcloud version:
2.5.0/2.4.0
###Python version:
2.7.5
###Operating System:
RHEL 7.3
###Steps which are needed to reproduce it:
Using the following code to list objects in Azure blob container:
```
from libcloud.storage.types import Provider
from libcloud.storage.providers import get_driver
cls = get_driver(Provider.AZURE_BLOBS)
driver = cls(key='XXX', secret='XXXXXXXX')
container = driver.get_container('myContainer')
objs = driver.list_container_objects(container, '123')
print objs
```
It will throw the following exception at line `objs = driver.list_container_objects(container, '123')`:
```
>>> objs = driver.list_container_objects(container, '123')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/site-packages/libcloud/storage/drivers/azure_blobs.py", line 437, in list_container_objects
ex_prefix=ex_prefix))
File "/usr/lib/python2.7/site-packages/libcloud/storage/drivers/azure_blobs.py", line 401, in iterate_container_objects
params=params)
File "/usr/lib/python2.7/site-packages/libcloud/common/base.py", line 636, in request
response = responseCls(**kwargs)
File "/usr/lib/python2.7/site-packages/libcloud/common/base.py", line 155, in __init__
self.object = self.parse_body()
File "/usr/lib/python2.7/site-packages/libcloud/common/azure.py", line 97, in parse_body
return super(AzureResponse, self).parse_body()
File "/usr/lib/python2.7/site-packages/libcloud/common/base.py", line 233, in parse_body
driver=self.connection.driver)
libcloud.common.types.MalformedResponseError: <MalformedResponseException in <libcloud.storage.drivers.azure_blobs.AzureBlobsStorageDriver object at 0x7f9f08838f90> 'Failed to parse XML'>: u'\u010f\u0165\u017c<?xml version="1.0" encoding="utf-8"?><EnumerationResults ContainerName="https://.....
```
The response XML seems to be valid except it begins with `u'\u010f\u0165\u017c`.
I tried in python 2.7.15 and it works fine. Maybe this issue is related to python 2.7.5 only?
Python 2.7.5 is the default version for RHEL 7.3, so please help me. Thanks!
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services