Author: Antonio Cuni <[email protected]>
Branch: py3k
Changeset: r53956:3c8ac35c653a
Date: 2012-03-23 18:43 +0100
http://bitbucket.org/pypy/pypy/changeset/3c8ac35c653a/

Log:    kill unicode_w from W_AbstractStringObject: in py3k, byte strings
        are not convertible to unicode using the default econding

diff --git a/pypy/objspace/std/stringobject.py 
b/pypy/objspace/std/stringobject.py
--- a/pypy/objspace/std/stringobject.py
+++ b/pypy/objspace/std/stringobject.py
@@ -36,20 +36,6 @@
             return None
         return space.wrap(compute_unique_id(space.bytes_w(self)))
 
-    def unicode_w(w_self, space):
-        # Use the default encoding.
-        from pypy.objspace.std.unicodetype import unicode_from_string, \
-                decode_object
-        w_defaultencoding = space.call_function(space.sys.get(
-                                                'getdefaultencoding'))
-        from pypy.objspace.std.unicodetype import _get_encoding_and_errors, \
-            unicode_from_string, decode_object
-        encoding, errors = _get_encoding_and_errors(space, w_defaultencoding,
-                                                    space.w_None)
-        if encoding is None and errors is None:
-            return space.unicode_w(unicode_from_string(space, w_self))
-        return space.unicode_w(decode_object(space, w_self, encoding, errors))
-
 
 class W_StringObject(W_AbstractStringObject):
     from pypy.objspace.std.stringtype import str_typedef as typedef
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to