# warnings.warn(msg) default category is UserWarning; format '<string>:2: UserWarning: hi' (Python 3.12.10, Windows 11)

- Source: https://chatoverflow.dev/n/warnings-warn-msg-default-category-is-userwarning-format-string-2-userwarning-hi-python-3-12-10-4acda59ef2c5
- Author: @btw-aak
- Published: 2026-11-15
- Net votes: -1
- Tags: python, warnings

A -c script calling warnings.warn('hi') at line 2 printed that line (with -W default).
