@@ -389,8 +389,12 @@ def passValue(value):
389389 self .assertEqual (passValue ('str\x00 ing' ), 'str\x00 ing' )
390390 self .assertEqual (passValue ('str\x00 ing\xbd ' ), 'str\x00 ing\xbd ' )
391391 self .assertEqual (passValue ('str\x00 ing\u20ac ' ), 'str\x00 ing\u20ac ' )
392- self .assertEqual (passValue (b'str\x00 ing' ), 'str\x00 ing' )
393- self .assertEqual (passValue (b'str\xc0 \x80 ing' ), 'str\x00 ing' )
392+ self .assertEqual (passValue (b'str\x00 ing' ),
393+ b'str\x00 ing' if self .wantobjects else 'str\x00 ing' )
394+ self .assertEqual (passValue (b'str\xc0 \x80 ing' ),
395+ b'str\xc0 \x80 ing' if self .wantobjects else 'str\xc0 \x80 ing' )
396+ self .assertEqual (passValue (b'str\xbd ing' ),
397+ b'str\xbd ing' if self .wantobjects else 'str\xbd ing' )
394398 for i in (0 , 1 , - 1 , 2 ** 31 - 1 , - 2 ** 31 ):
395399 self .assertEqual (passValue (i ), i if self .wantobjects else str (i ))
396400 for f in (0.0 , 1.0 , - 1.0 , 1 / 3 ,
@@ -440,12 +444,14 @@ def float_eq(actual, expected):
440444 check ('string\xbd ' , 'string\xbd ' )
441445 check ('string\u20ac ' , 'string\u20ac ' )
442446 check (b'string' , 'string' )
443- check (b'string\xe2 \x82 \xac ' , 'string\u20ac ' )
447+ check (b'string\xe2 \x82 \xac ' , 'string\xe2 \x82 \xac ' )
448+ check (b'string\xbd ' , 'string\xbd ' )
444449 check ('str\x00 ing' , 'str\x00 ing' )
445450 check ('str\x00 ing\xbd ' , 'str\x00 ing\xbd ' )
446451 check ('str\x00 ing\u20ac ' , 'str\x00 ing\u20ac ' )
447- check (b'str\xc0 \x80 ing' , 'str\x00 ing' )
448- check (b'str\xc0 \x80 ing\xe2 \x82 \xac ' , 'str\x00 ing\u20ac ' )
452+ check (b'str\x00 ing' , 'str\x00 ing' )
453+ check (b'str\xc0 \x80 ing' , 'str\xc0 \x80 ing' )
454+ check (b'str\xc0 \x80 ing\xe2 \x82 \xac ' , 'str\xc0 \x80 ing\xe2 \x82 \xac ' )
449455 for i in (0 , 1 , - 1 , 2 ** 31 - 1 , - 2 ** 31 ):
450456 check (i , str (i ))
451457 for f in (0.0 , 1.0 , - 1.0 ):
@@ -493,9 +499,9 @@ def test_splitlist(self):
493499 if tcl_version >= (8 , 5 ):
494500 if not self .wantobjects or get_tk_patchlevel () < (8 , 5 , 5 ):
495501 # Before 8.5.5 dicts were converted to lists through string
496- expected = ('12' , '\u20ac ' , '\u20ac ' , '3.4' )
502+ expected = ('12' , '\u20ac ' , '\xe2 \x82 \xac ' , '3.4' )
497503 else :
498- expected = (12 , '\u20ac ' , ' \u20ac ' , (3.4 ,))
504+ expected = (12 , '\u20ac ' , b' \xe2 \x82 \xac ' , (3.4 ,))
499505 testcases += [
500506 (call ('dict' , 'create' , 12 , '\u20ac ' , b'\xe2 \x82 \xac ' , (3.4 ,)),
501507 expected ),
@@ -543,9 +549,9 @@ def test_split(self):
543549 if tcl_version >= (8 , 5 ):
544550 if not self .wantobjects or get_tk_patchlevel () < (8 , 5 , 5 ):
545551 # Before 8.5.5 dicts were converted to lists through string
546- expected = ('12' , '\u20ac ' , '\u20ac ' , '3.4' )
552+ expected = ('12' , '\u20ac ' , '\xe2 \x82 \xac ' , '3.4' )
547553 else :
548- expected = (12 , '\u20ac ' , ' \u20ac ' , (3.4 ,))
554+ expected = (12 , '\u20ac ' , b' \xe2 \x82 \xac ' , (3.4 ,))
549555 testcases += [
550556 (call ('dict' , 'create' , 12 , '\u20ac ' , b'\xe2 \x82 \xac ' , (3.4 ,)),
551557 expected ),
0 commit comments