From 256978a0eea5238bb1f1896a1108616d3b3ed292 Mon Sep 17 00:00:00 2001 From: Wu Wenxiang Date: Fri, 2 Aug 2013 20:51:58 +0800 Subject: [PATCH] Assignment to reserved built-in symbol "file" In file: tests/test_swiftclient.py, test_unicode_ok() & test_chunk_warning() Fixes bug #1207736 Change-Id: I0a822802ec8910e9aec36ae5af775f8abb384d34 --- tests/test_swiftclient.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/test_swiftclient.py b/tests/test_swiftclient.py index a072878..7a10d34 100644 --- a/tests/test_swiftclient.py +++ b/tests/test_swiftclient.py @@ -539,12 +539,12 @@ class TestPutObject(MockHttpTest): def test_unicode_ok(self): conn = c.http_connection(u'http://www.test.com/') - file = StringIO.StringIO(u'\u5929\u7a7a\u4e2d\u7684\u4e4c\u4e91') + mock_file = StringIO.StringIO(u'\u5929\u7a7a\u4e2d\u7684\u4e4c\u4e91') args = (u'\u5929\u7a7a\u4e2d\u7684\u4e4c\u4e91', '\u5929\u7a7a\u4e2d\u7684\u4e4c\u4e91', u'\u5929\u7a7a\u4e2d\u7684\u4e4c\u4e91', u'\u5929\u7a7a\u4e2d\u7684\u4e4c\u4e91', - file) + mock_file) headers = {'X-Header1': u'\u5929\u7a7a\u4e2d\u7684\u4e4c\u4e91', 'X-2': 1, 'X-3': {'a': 'b'}, 'a-b': '.x:yz mn:fg:lp'} @@ -559,8 +559,8 @@ class TestPutObject(MockHttpTest): def test_chunk_warning(self): conn = c.http_connection('http://www.test.com/') - file = StringIO.StringIO('asdf') - args = ('asdf', 'asdf', 'asdf', 'asdf', file) + mock_file = StringIO.StringIO('asdf') + args = ('asdf', 'asdf', 'asdf', 'asdf', mock_file) resp = MockHttpResponse() conn[1].getresponse = resp.fake_response conn[1].send = resp.fake_send