Skip to content

Commit 02fb04c

Browse files
unknownunknown
unknown
authored and
unknown
committed
fix github issue Azure#57. issue link: Azure#57
1 parent e6621f0 commit 02fb04c

24 files changed

+15
-3
lines changed

src/azure/__init__.pyc

23.1 KB
Binary file not shown.

src/azure/http/__init__.pyc

2.58 KB
Binary file not shown.

src/azure/http/batchclient.pyc

9.34 KB
Binary file not shown.

src/azure/http/httpclient.pyc

4.02 KB
Binary file not shown.

src/azure/http/winhttp.pyc

14.6 KB
Binary file not shown.

src/azure/servicebus/__init__.pyc

27.1 KB
Binary file not shown.
28.9 KB
Binary file not shown.

src/azure/storage/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -564,6 +564,9 @@ def convert_entity_to_xml(source):
564564
properties_str += ''.join([' m:type="', mtype, '"'])
565565
properties_str += ''.join(['>', xml_escape(value), '</d:', name, '>'])
566566

567+
if isinstance(properties_str, unicode):
568+
properties_str = properties_str.encode(encoding='utf-8')
569+
567570
#generate the entity_body
568571
entity_body = entity_body.format(properties=properties_str)
569572
xmlstr = _create_entry(entity_body)

src/azure/storage/__init__.pyc

34.6 KB
Binary file not shown.

src/azure/storage/blobservice.pyc

34.5 KB
Binary file not shown.
1.85 KB
Binary file not shown.

src/azure/storage/queueservice.pyc

14.8 KB
Binary file not shown.
7.44 KB
Binary file not shown.

src/azure/storage/storageclient.pyc

3.86 KB
Binary file not shown.

src/azure/storage/tableservice.pyc

16 KB
Binary file not shown.

test/azuretest/__init__.pyc

169 Bytes
Binary file not shown.

test/azuretest/test_blobservice.pyc

42.5 KB
Binary file not shown.
2.57 KB
Binary file not shown.

test/azuretest/test_queueservice.pyc

13.7 KB
Binary file not shown.
35.1 KB
Binary file not shown.
4.98 KB
Binary file not shown.

test/azuretest/test_tableservice.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#-------------------------------------------------------------------------
1+
#-------------------------------------------------------------------------
22
# Copyright 2011 Microsoft Corporation
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -17,7 +17,6 @@
1717
from azure.storage import EntityProperty, Entity, StorageServiceProperties
1818
from azure import WindowsAzureError
1919

20-
2120
from azuretest.util import (credentials,
2221
getUniqueTestRunID,
2322
STATUS_OK,
@@ -1039,8 +1038,18 @@ def test_batch_different_table_operations_fail(self):
10391038

10401039
self.tc.cancel_batch()
10411040

1041+
def test_unicode_xml_encoding(self):
1042+
''' regression test for github issue #57'''
1043+
# Act
1044+
self._create_table(self.table_name)
1045+
self.tc.insert_entity(self.table_name, {'PartitionKey': 'test', 'RowKey': 'test1', 'Description': u'ꀕ'})
1046+
self.tc.insert_entity(self.table_name, {'PartitionKey': 'test', 'RowKey': 'test2', 'Description': 'ꀕ'})
1047+
resp = self.tc.query_entities(self.table_name, "PartitionKey eq 'test'")
10421048
# Assert
1043-
1049+
self.assertEquals(len(resp), 2)
1050+
self.assertEquals(resp[0].Description, u'ꀕ')
1051+
self.assertEquals(resp[1].Description, u'ꀕ')
1052+
10441053
#------------------------------------------------------------------------------
10451054
if __name__ == '__main__':
10461055
unittest.main()

test/azuretest/test_tableservice.pyc

34.2 KB
Binary file not shown.

test/azuretest/util.pyc

4.81 KB
Binary file not shown.

0 commit comments

Comments
 (0)