Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Type name cannot contain surrogates #4786

Copy link
Copy link
Open
@DimitrisJim

Description

@DimitrisJim
Issue body actions

Issue caught after an update to test_builtins in #4765. Creating a new type and supplying as a name a value that contains a surrogate (in this case \udcdc is used) should result in an error.

RustPython:

>>> type("A\udcdcB", (), {})
>>> <class '__main__.A�B'>

While in CPython:

>>> type("A\udcdcB", (), {})
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
UnicodeEncodeError: 'utf-8' codec can't encode character '\udcdc' in position 1: surrogates not allowed

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugSomething isn't workingSomething isn't workingC-compatA discrepancy between RustPython and CPythonA discrepancy between RustPython and CPython

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.