Skip to content

A PyInfo cache populated under v20.28.1 cannot be loaded and used under v20.29.0 -- AttributeError on 'free_threaded' #2825

@sirosen

Description

@sirosen

Issue

Unfortunately, I still don't have a reasonable MRE to show.
This originally surfaced for me in a closed-source build process built on Poetry -- my initial bug report here.

However, I eventually found that my project was installing virtualenv==20.28.1 into an environment where 20.29.0 was already running. (Full detail in this comment, same issue.)

I'm fairly certain that I'm getting a v20.28.1 PyInfo object loaded from the cache while running v20.29.0, but as I'm unable to reproduce it reliably, I don't yet know how this could happen. In the original case, I believe that poetry is running virtualenv.cli_run in threads, and multiple versions could be executing simultaneously.
If I can reproduce, obviously that would help. If threaded invocations are not supported, that may carry back to poetry as a consideration.

Environment

Provide at least:

  • OS: Dockerized Debian -- python3.10 slim-bookworm

  • pip list of the host python where virtualenv is installed -- cannot provide from the closed source original (still working on a MRE)

    # sorry, still working on the MRE

Output of the virtual environment creation

Make sure to run the creation with -vvv --with-traceback:

# also needs to wait for the MRE

I really don't like that I'm opening a ticket without an MRE, but since this is new in the today's release, I think it's worth reporting.
If this cache load is something which should be supported, we just need to populate free_threaded explicitly if it's missing in PyInfo._from_dict -- I would be happy to open a PR with that change if appropriate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions