Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: ResourceWarning: Unclosed file <tempfile.SpooledTemporaryFile object ...> #3835

Open
4 tasks
gsakkis opened this issue Oct 20, 2024 · 0 comments · May be fixed by #3838
Open
4 tasks

Bug: ResourceWarning: Unclosed file <tempfile.SpooledTemporaryFile object ...> #3835

gsakkis opened this issue Oct 20, 2024 · 0 comments · May be fixed by #3838
Labels
Bug 🐛 This is something that is not working as expected

Comments

@gsakkis
Copy link
Contributor

gsakkis commented Oct 20, 2024

Description

Running the Litestar tests with -W error reveals several pytest.PytestUnraisableExceptionWarning: Exception ignored in: <function SpooledTemporaryFile.__del__:

================================================================================ short test summary info ================================================================================
FAILED tests/unit/test_kwargs/test_multipart_data.py::test_multipart_request_files - pytest.PytestUnraisableExceptionWarning: Exception ignored in: <function SpooledTemporaryFile.__del__ at 0x10189cd60>
FAILED tests/unit/test_kwargs/test_multipart_data.py::test_multipart_request_files_with_content_type - pytest.PytestUnraisableExceptionWarning: Exception ignored in: <function SpooledTemporaryFile.__del__ at 0x10189cd60>
FAILED tests/unit/test_kwargs/test_multipart_data.py::test_multipart_request_multiple_files - pytest.PytestUnraisableExceptionWarning: Exception ignored in: <function SpooledTemporaryFile.__del__ at 0x10189cd60>
FAILED tests/unit/test_kwargs/test_multipart_data.py::test_multipart_request_multiple_files_with_headers - pytest.PytestUnraisableExceptionWarning: Exception ignored in: <function SpooledTemporaryFile.__del__ at 0x10189cd60>
FAILED tests/unit/test_kwargs/test_multipart_data.py::test_multi_items - pytest.PytestUnraisableExceptionWarning: Exception ignored in: <function SpooledTemporaryFile.__del__ at 0x10189cd60>
FAILED tests/unit/test_kwargs/test_multipart_data.py::test_multipart_request_mixed_files_and_data - pytest.PytestUnraisableExceptionWarning: Exception ignored in: <function SpooledTemporaryFile.__del__ at 0x10189cd60>
FAILED tests/unit/test_kwargs/test_multipart_data.py::test_multipart_request_with_charset_for_filename - pytest.PytestUnraisableExceptionWarning: Exception ignored in: <function SpooledTemporaryFile.__del__ at 0x10189cd60>
FAILED tests/unit/test_kwargs/test_multipart_data.py::test_multipart_request_without_charset_for_filename - pytest.PytestUnraisableExceptionWarning: Exception ignored in: <function SpooledTemporaryFile.__del__ at 0x10189cd60>
FAILED tests/unit/test_kwargs/test_multipart_data.py::test_multipart_request_with_asterisks_filename - pytest.PytestUnraisableExceptionWarning: Exception ignored in: <function SpooledTemporaryFile.__del__ at 0x10189cd60>
FAILED tests/unit/test_kwargs/test_multipart_data.py::test_postman_multipart_form_data - pytest.PytestUnraisableExceptionWarning: Exception ignored in: <function SpooledTemporaryFile.__del__ at 0x10189cd60>
FAILED tests/unit/test_kwargs/test_multipart_data.py::test_upload_multiple_files[2-True] - pytest.PytestUnraisableExceptionWarning: Exception ignored in: <function SpooledTemporaryFile.__del__ at 0x10189cd60>
FAILED tests/unit/test_kwargs/test_multipart_data.py::test_upload_multiple_files[2-False] - pytest.PytestUnraisableExceptionWarning: Exception ignored in: <function SpooledTemporaryFile.__del__ at 0x10189cd60>
FAILED tests/unit/test_kwargs/test_multipart_data.py::test_upload_multiple_files_in_model[1-Files] - pytest.PytestUnraisableExceptionWarning: Exception ignored in: <function SpooledTemporaryFile.__del__ at 0x10189cd60>
FAILED tests/unit/test_kwargs/test_multipart_data.py::test_upload_multiple_files_in_model[1-OptionalFiles] - pytest.PytestUnraisableExceptionWarning: Exception ignored in: <function SpooledTemporaryFile.__del__ at 0x10189cd60>
FAILED tests/unit/test_kwargs/test_multipart_data.py::test_upload_multiple_files_in_model[2-Files] - pytest.PytestUnraisableExceptionWarning: Exception ignored in: <function SpooledTemporaryFile.__del__ at 0x10189cd60>
FAILED tests/unit/test_kwargs/test_multipart_data.py::test_upload_multiple_files_in_model[2-OptionalFiles] - pytest.PytestUnraisableExceptionWarning: Exception ignored in: <function SpooledTemporaryFile.__del__ at 0x10189cd60>
============================================================================= 16 failed, 21 passed in 0.75s =============================================================================

URL to code causing the issue

No response

MCVE

# Your MCVE code here

Steps to reproduce

1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

Screenshots

"![SCREENSHOT_DESCRIPTION](SCREENSHOT_LINK.png)"

Logs

No response

Litestar Version

main

Platform

  • Linux
  • Mac
  • Windows
  • Other (Please specify in the description above)

Note

While we are open for sponsoring on GitHub Sponsors and
OpenCollective, we also utilize Polar.sh to engage in pledge-based sponsorship.

Check out all issues funded or available for funding on our Polar.sh dashboard

  • If you would like to see an issue prioritized, make a pledge towards it!
  • We receive the pledge once the issue is completed & verified
  • This, along with engagement in the community, helps us know which features are a priority to our users.
Fund with Polar
@gsakkis gsakkis added the Bug 🐛 This is something that is not working as expected label Oct 20, 2024
@gsakkis gsakkis linked a pull request Oct 22, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug 🐛 This is something that is not working as expected
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant