Skip to content

Ensure temporary directory cleanup on error for Python 3.9 or older #9753

@AsifArmanRahman

Description

@AsifArmanRahman

Description

While cleanup takes place for temporary_directory function even if errors takes place while it's yielded on python version 3.10 and higher, for python version 3.9 or lower the cleanup takes place only if no error takes place.

Workarounds

While a restart would cleanup left over tmp folders for Unix-based OS, Windows would do the same after keeping it intact for a long while, otherwise one would have to manually clean it.

Poetry Installation Method

install.python-poetry.org

Operating System

Ubuntu 24.04.1 LTS

Poetry Version

1.8.3

Poetry Configuration

cache-dir = "~/.cache/pypoetry"
experimental.system-git-client = false
installer.max-workers = null
installer.modern-installation = true
installer.no-binary = null
installer.parallel = true
keyring.enabled = true
solver.lazy-wheel = true
virtualenvs.create = true
virtualenvs.in-project = null
virtualenvs.options.always-copy = false
virtualenvs.options.no-pip = false
virtualenvs.options.no-setuptools = false
virtualenvs.options.system-site-packages = false
virtualenvs.path = "{cache-dir}/virtualenvs"  # ~/.cache/pypoetry/virtualenvs
virtualenvs.prefer-active-python = false
virtualenvs.prompt = "{project_name}-py{python_version}"
warnings.export = true

Python Sysconfig

No response

Example pyproject.toml

No response

Poetry Runtime Logs

Not applicable

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugSomething isn't working as expectedstatus/triageThis issue needs to be triaged

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions