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

linecache.cache sometimes has an entry for<string> under Python 3.13.0a5 #117174

Closed
Labels
type-bugAn unexpected behavior, bug, or error
@Zac-HD

Description

@Zac-HD

Bug report

Bug description:

I noticed this via Hypothesis' pretty-printer forlambda functions, and tracked the divergence through theinspect module tolinecache:

importlinecachedeftest():print(linecache.cache["<string>"])# expected to raise KeyErrorassertFalse

If I run this snippet withpython3.13 -Wignore -m pytest repro.py, or any older Python version, you'll get the expectedKeyError. But if I append-n2 to the command, it prints(44, None, ['import sys;exec(eval(sys.stdin.readline()))\n'], '<string>')!

(python3.13 -m pip install pytest pytest-xdist will get the dependencies for this)

That's thepopen bootstrap line fromexecnet, which handles running code across multiple processes forpytest-xdist. At this point I've foundlinecache.cache.pop("<string>", None) to be an acceptable workaround, and since I don't have any particular knowledge of either the CPython or execnet code that's as far as I investigated.

CPython versions tested on:

3.8, 3.9, 3.10, 3.11, 3.12, 3.13

Operating systems tested on:

Linux

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp