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

Global String Objects are Interned Only in the First Interpreter #106931

Closed
Labels
3.12only security fixes3.13bugs and security fixestopic-subinterpreterstype-bugAn unexpected behavior, bug, or error
@ericsnowcurrently

Description

@ericsnowcurrently

When a string object is interned via_PyUnicode_InternInPlace(), its "state.interned" field is set. Afterward, subsequent calls to_PyUnicode_InternInPlace() will skip that string. The problem is that some strings may be used in multiple interpreters, which each have their own interned dict. The string is shared between the interpreters, along with its "state.interned" field. That means the string will only be interned in the first interpreter where_PyUnicode_InternInPlace() is called (ignoring races in the function, e.g.gh-106930).

We need to fix it so one of the following is true:

  • there should be one global interned "dict" shared by all interpreters (we tried this already and it is very tricky)
  • strings are always interned in every interpreter, regardless of the "state.interned" value

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.12only security fixes3.13bugs and security fixestopic-subinterpreterstype-bugAn unexpected behavior, bug, or error

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp