Author: Matti Picus <[email protected]>
Branch: unicode-utf8-py3
Changeset: r94997:2b6c2810e8bc
Date: 2018-08-11 23:38 -0700
http://bitbucket.org/pypy/pypy/changeset/2b6c2810e8bc/
Log: bytes is already utf8, no need to decode
diff --git a/pypy/objspace/std/bytesobject.py b/pypy/objspace/std/bytesobject.py
--- a/pypy/objspace/std/bytesobject.py
+++ b/pypy/objspace/std/bytesobject.py
@@ -423,9 +423,7 @@
"unicode object expected, received bytes instead")
def utf8_w(self, space):
- # Use the default encoding.
- encoding = getdefaultencoding(space)
- return space.utf8_w(decode_object(space, self, encoding, None))
+ return self._value
def buffer_w(self, space, flags):
space.check_buf_flags(flags, True)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit