Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • pypy pypy
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 697
    • Issues 697
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 16
    • Merge requests 16
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • PyPyPyPy
  • pypypypy
  • Issues
  • #3178
Closed
Open
Issue created Feb 29, 2020 by QIngHuiZhao@QingHui

pypy-7.3-2.7.13 UnicodeEncodeError: 'ascii' codec can't encode character

  • parse a "big" json data file, print some utf8 code is error

  • if its a "little" json data file, no error happend.

  • if i use pypy-6.0.0-2.7 there is no error

  • so i think this is a bug of pypy7.3

  • sample code is:

pypy make-test-data.py
pypy test2.py
  • exception is:
Traceback (most recent call last):
  File "test2.py", line 194, in <module>
    ConfigureHelper.decode_utf8_objs(datas)
  File "test2.py", line 132, in decode_utf8_objs
    ndatas[key] = self.decode_utf8_objs(val)
  File "test2.py", line 137, in decode_utf8_objs
    ndatas.append(self.decode_utf8_objs(val))
  File "test2.py", line 132, in decode_utf8_objs
    ndatas[key] = self.decode_utf8_objs(val)
  File "test2.py", line 123, in decode_utf8_objs
    print "decode_utf8_objs ", type(datas), "repr=", datas
UnicodeEncodeError: 'ascii' codec can't encode character u'\u94bb' in position 0: ordinal not in range(128)
  • the python code please see the attach file

make-test-data.py

test2.py

  • my pypy version is
  • Python 2.7.13 (724f1a7d62e8, Feb 29 2020, 09:21:35)
  • [PyPy 7.3.0 with GCC 9.2.0]
  • i build it myself with pypy2.7-v7.3.0-src.tar.bz2 + GCC9.2 + CentOs7-64bit-Lasted
  • i use pypy2.7-v7.3.0-linux64 (download form https://bitbucket.org/pypy/pypy/downloads/pypy2.7-v7.3.0-linux64.tar.bz2) also the same error
Edited Feb 29, 2020 by QIngHuiZhao
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking