Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

_interpreters.set___main___attrs raises SystemError when passed a non-dict object #135855

Closed
@brianschubert

Description

@brianschubert

Bug report

Bug description:

This snippet:

import_interpretersimporttypesi=_interpreters.create()_interpreters.set___main___attrs(i,types.MappingProxyType({"a":1}))

raises:

Traceback (most recent call last):  File"/home/brian/Projects/open-contrib/cpython/temp.py", line27, in<module>    _interpreters.set___main___attrs(i, types.MappingProxyType({"a":1}))~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^SystemError:Objects/dictobject.c:4162: bad argument to internal function

This happens duringthis call to_PyXI_Enter which callsPyDict_Size onupdates.

Thepublic interface always passes adict, and other paths that call_PyXI_Enter check for an actual dict (e.g.,exec). I think it makes sense to do the same thing here. PR forthcoming.

CPython versions tested on:

CPython main branch

Operating systems tested on:

Linux

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp