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

ResourceWarning: Enable tracemalloc to get the object allocation traceback #1413

Closed
josephernest opened this issue Mar 9, 2023 · 2 comments

Comments

@josephernest
Copy link

Hi there,

Do you know what could be the reason for this message:

D:\bottle.py:2269: ResourceWarning: unclosed file <_io.BufferedReader name='D:\\test.webm'>
  func()
ResourceWarning: Enable tracemalloc to get the object allocation traceback
wsgiref\handlers.py:183: ResourceWarning: unclosed file <_io.BufferedReader name='D:\\test.webm'>
ResourceWarning: Enable tracemalloc to get the object allocation traceback

when I serve a HTML page containing

?

The video is loading successfully, but I'd like to remove this warning message if possible.

Thanks!

All the best

@FriedrichFroebel
Copy link

Have you tried enable memory tracing through tracemalloc as proposed in the warning message? Could you provide some minimal example code reproducing this issue?

@defnull
Copy link
Member

defnull commented Feb 15, 2025

If you are using bottle.static_file() to send files, then that should not happen and I cannot reproduce the issue with a recent version of bottle. Please provide more context, e.g. the ouput of tracemalloc and the exact version of Bottle in use, as well as the core that serves files.

@defnull defnull closed this as completed Feb 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants