@@ -31,14 +31,14 @@ def testPack():
3131
3232def testPackUnicode ():
3333 test_data = [
34- six .u ("" ), six .u ("abcd" ), ( six .u ("defgh" ),) , six .u ("Русский текст" ),
34+ six .u ("" ), six .u ("abcd" ), [ six .u ("defgh" )] , six .u ("Русский текст" ),
3535 ]
3636 for td in test_data :
37- re = unpackb (packb (td , encoding = 'utf-8' ), use_list = 0 , encoding = 'utf-8' )
37+ re = unpackb (packb (td , encoding = 'utf-8' ), use_list = 1 , encoding = 'utf-8' )
3838 assert_equal (re , td )
3939 packer = Packer (encoding = 'utf-8' )
4040 data = packer .pack (td )
41- re = Unpacker (BytesIO (data ), encoding = 'utf-8' ).unpack ()
41+ re = Unpacker (BytesIO (data ), encoding = 'utf-8' , use_list = 1 ).unpack ()
4242 assert_equal (re , td )
4343
4444def testPackUTF32 ():
@@ -63,28 +63,27 @@ def testPackBytes():
6363 check (td )
6464
6565def testIgnoreUnicodeErrors ():
66- re = unpackb (packb (b'abc\xed def' ),
67- encoding = 'utf-8' , unicode_errors = 'ignore' )
66+ re = unpackb (packb (b'abc\xed def' ), encoding = 'utf-8' , unicode_errors = 'ignore' , use_list = 1 )
6867 assert_equal (re , "abcdef" )
6968
7069@raises (UnicodeDecodeError )
7170def testStrictUnicodeUnpack ():
72- unpackb (packb (b'abc\xed def' ), encoding = 'utf-8' )
71+ unpackb (packb (b'abc\xed def' ), encoding = 'utf-8' , use_list = 1 )
7372
7473@raises (UnicodeEncodeError )
7574def testStrictUnicodePack ():
7675 packb (six .u ("abc\xed def" ), encoding = 'ascii' , unicode_errors = 'strict' )
7776
7877def testIgnoreErrorsPack ():
79- re = unpackb (packb (six .u ("abcФФФdef" ), encoding = 'ascii' , unicode_errors = 'ignore' ), encoding = 'utf-8' )
78+ re = unpackb (packb (six .u ("abcФФФdef" ), encoding = 'ascii' , unicode_errors = 'ignore' ), encoding = 'utf-8' , use_list = 1 )
8079 assert_equal (re , six .u ("abcdef" ))
8180
8281@raises (TypeError )
8382def testNoEncoding ():
8483 packb (six .u ("abc" ), encoding = None )
8584
8685def testDecodeBinary ():
87- re = unpackb (packb ("abc" ), encoding = None )
86+ re = unpackb (packb ("abc" ), encoding = None , use_list = 1 )
8887 assert_equal (re , b"abc" )
8988
9089def testPackFloat ():
0 commit comments