Skip to content

Valid Unicode identifier can be used as field name but not as kwargs #1405

Closed
@serge-sans-paille

Description

@serge-sans-paille

Simple reproducer:

>>> import attrs
>>> A = attrs.make_class('A', ['Ŀ椁楮潴桶'])
>>> A(Ŀ椁楮潴桶=1)  # this is fine
A(Ŀ椁楮潴桶=1)
>>> A(**{'Ŀ椁楮潴桶':1})  # this is not fine
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: A.__init__() got an unexpected keyword argument 'Ŀ椁楮潴桶'

This was raised by fuzzing when setting up google/oss-fuzz#13009

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions