@@ -3705,7 +3705,7 @@ class Compress(Builtin):
37053705
37063706 """
37073707
3708- attributes = "Protected"
3708+ attributes = ( "Protected" ,)
37093709
37103710 options = {
37113711 "Method" : "{}" ,
@@ -3720,9 +3720,9 @@ def apply(self, expr, evaluation, options):
37203720 string = string .encode ("utf-8" )
37213721
37223722 # TODO Implement other Methods
3723+ # Shouldn't be this a ByteArray?
37233724 result = zlib .compress (string )
3724- result = base64 .encodebytes (result ).decode ("utf8" )
3725-
3725+ result = base64 .b64encode (result ).decode ("utf8" )
37263726 return String (result )
37273727
37283728
@@ -3744,12 +3744,12 @@ class Uncompress(Builtin):
37443744 = x ^ 2 + y Sin[x] + 10 Log[15]
37453745 """
37463746
3747- attributes = "Protected"
3747+ attributes = ( "Protected" ,)
37483748
37493749 def apply (self , string , evaluation ):
37503750 "Uncompress[string_String]"
3751- string = string .get_string_value ().encode ("utf-8" )
3752- string = base64 .decodebytes (string )
3751+ string = string .get_string_value () # .encode("utf-8")
3752+ string = base64 .b64decode (string )
37533753 tmp = zlib .decompress (string )
37543754 tmp = tmp .decode ("utf-8" )
37553755 return evaluation .parse (tmp )
0 commit comments