From a01f3310e746219759169948aac439a7c9d4156a Mon Sep 17 00:00:00 2001 From: Naofal-Helal Date: Sun, 22 Sep 2024 13:38:39 +0300 Subject: [PATCH] Ignore resource warning --- news/6151.bugfix.rst | 1 + pipenv/routines/install.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 news/6151.bugfix.rst diff --git a/news/6151.bugfix.rst b/news/6151.bugfix.rst new file mode 100644 index 0000000000..dc9ba2f519 --- /dev/null +++ b/news/6151.bugfix.rst @@ -0,0 +1 @@ +Disable ``ResourceWarning`` warning for temporary files that are cleaned on program exit. diff --git a/pipenv/routines/install.py b/pipenv/routines/install.py index 1523fdbb67..6f6281be5d 100644 --- a/pipenv/routines/install.py +++ b/pipenv/routines/install.py @@ -48,7 +48,7 @@ def do_install( requirements_directory = fileutils.create_tracked_tempdir( suffix="-requirements", prefix="pipenv-" ) - warnings.filterwarnings("default", category=ResourceWarning) + warnings.filterwarnings("ignore", category=ResourceWarning) packages = packages if packages else [] editable_packages = editable_packages if editable_packages else [] package_args = [p for p in packages if p] + [p for p in editable_packages if p]