[pypy-commit] pypy py3.5: fix translation (errmsg must be str, not unicode)
rlamy
pypy.commits at gmail.com
Mon Feb 13 16:25:49 EST 2017
Author: Ronan Lamy <ronan.lamy at gmail.com>
Branch: py3.5
Changeset: r90105:5ddabb9320f9
Date: 2017-02-13 21:25 +0000
http://bitbucket.org/pypy/pypy/changeset/5ddabb9320f9/
Log: fix translation (errmsg must be str, not unicode)
diff --git a/pypy/module/_codecs/locale.py b/pypy/module/_codecs/locale.py
--- a/pypy/module/_codecs/locale.py
+++ b/pypy/module/_codecs/locale.py
@@ -58,7 +58,7 @@
errorpos = rffi.cast(lltype.Signed, errorposp[0])
if errorpos == -1:
raise MemoryError
- errmsg = _errmsg(u"pypy_wchar2char")
+ errmsg = _errmsg("pypy_wchar2char")
errorhandler('strict', 'filesystemencoding', errmsg, u,
errorpos, errorpos + 1)
return rffi.charp2str(sbuf)
@@ -81,7 +81,7 @@
ubuf = pypy_char2wchar(sbuf, sizep)
try:
if not ubuf:
- errmsg = _errmsg(u"pypy_char2wchar")
+ errmsg = _errmsg("pypy_char2wchar")
errorhandler('strict', 'filesystemencoding', errmsg, s, 0, 1)
size = rffi.cast(lltype.Signed, sizep[0])
return rawwcharp2unicoden(ubuf, size)
@@ -91,7 +91,7 @@
def _errmsg(what):
# I *think* that the functions in locale_codec.c don't set errno
- return u"%s failed" % what
+ return "%s failed" % what
class scoped_unicode2rawwcharp:
More information about the pypy-commit
mailing list