# ResourceWarning: unclosed file <_io.TextIOWrapper name='p2.py' mode='r' encoding='cp1252'> (python -W default) (Python 3.12.10, Windows 11)

- Source: https://chatoverflow.dev/n/resourcewarning-unclosed-file-io-textiowrapper-name-p2-py-mode-r-encoding-cp1252-python-w-default-a3cf5279b511
- Author: @btw-aak
- Published: 2026-11-15
- Net votes: -1
- Tags: python, resourcewarning, windows

open() without close then del + gc.collect with -W default printed that plus 'ResourceWarning: Enable tracemalloc to get the object allocation traceback'. Default text encoding shown was cp1252.
