Author: Matti Picus <[email protected]>
Branch: unicode-utf8-py3
Changeset: r95011:bec02e0b6285
Date: 2018-08-17 16:16 +0300
http://bitbucket.org/pypy/pypy/changeset/bec02e0b6285/
Log: whoops
diff --git a/pypy/module/cpyext/unicodeobject.py
b/pypy/module/cpyext/unicodeobject.py
--- a/pypy/module/cpyext/unicodeobject.py
+++ b/pypy/module/cpyext/unicodeobject.py
@@ -818,10 +818,10 @@
if llerrors:
errors = rffi.charp2str(llerrors)
else:
- errors = None
+ errors = 'strict'
result, length, pos = str_decode_utf_16_helper(
- string, errors, final=True, errorhandler=None, byteorder=byteorder)
+ string, errors, True, None, byteorder=byteorder)
if pbyteorder is not None:
pbyteorder[0] = rffi.cast(rffi.INT_real, pos > 0)
return space.newutf8(result, length)
@@ -870,10 +870,10 @@
if llerrors:
errors = rffi.charp2str(llerrors)
else:
- errors = None
+ errors = 'strict'
result, length, pos = unicodehelper.str_decode_utf_32_helper(
- string, errors, final=True, errorhandler='strict', byteorder=byteorder)
+ string, errors, True, None, byteorder=byteorder)
if pbyteorder is not None:
pbyteorder[0] = rffi.cast(rffi.INT_real, pos>0)
return space.newutf8(result, length)
diff --git a/pypy/module/time/interp_time.py b/pypy/module/time/interp_time.py
--- a/pypy/module/time/interp_time.py
+++ b/pypy/module/time/interp_time.py
@@ -554,8 +554,8 @@
if HAS_TM_ZONE:
# CPython calls PyUnicode_DecodeLocale here should we do the same?
- tm_zone = decode_utf8sp(space, rffi.charp2str(t.c_tm_zone))
- extra = [space.newtext(tm_zone),
+ tm_zone, lgt, pos = decode_utf8sp(space, rffi.charp2str(t.c_tm_zone))
+ extra = [space.newtext(tm_zone, lgt),
space.newint(rffi.getintfield(t, 'c_tm_gmtoff'))]
w_time_tuple = space.newtuple(time_tuple + extra)
else:
@@ -578,7 +578,7 @@
lltype.free(t_ref, flavor='raw')
if not pbuf:
raise OperationError(space.w_ValueError,
- space.newtext(_get_error_msg()))
+ space.newtext(*_get_error_msg()))
return pbuf
tup_w = space.fixedview(w_tup)
@@ -744,7 +744,7 @@
if not p:
raise OperationError(space.w_ValueError,
- space.newtext(_get_error_msg()))
+ space.newtext(*_get_error_msg()))
return _tm_to_tuple(space, p)
def localtime(space, w_seconds=None):
@@ -762,7 +762,7 @@
if not p:
raise OperationError(space.w_OSError,
- space.newtext(_get_error_msg()))
+ space.newtext(*_get_error_msg()))
return _tm_to_tuple(space, p)
def mktime(space, w_tup):
diff --git a/pypy/objspace/fake/objspace.py b/pypy/objspace/fake/objspace.py
--- a/pypy/objspace/fake/objspace.py
+++ b/pypy/objspace/fake/objspace.py
@@ -218,6 +218,7 @@
def newutf8(self, x, l):
return w_some_obj()
+ @specialize.argtype(1)
def newtext(self, x, lgt=-1):
return w_some_obj()
newtext_or_none = newtext
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit