﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
36333	runserver: could not acquire lock for _io.BufferedWriter at interpreter shutdown	Klaas van Schelven		"I just ran into the following while running a `manage.py runserver`



{{{
Fatal Python error: _enter_buffered_busy: could not acquire lock for <_io.BufferedWriter name='<stderr>'> at interpreter shutdown, possibly due to daemon threads
Python runtime state: finalizing (tstate=0x000057b67d5dc5c0)                                                                                                                                                          Current thread 0x0000722a9aa4d000 (most recent call first):                                                  <no Python frame>                                                                                                                                                                                                   Extension modules: greenlet._greenlet, zope.interface._zope_interface_coptimizations, gevent.libev.corecext, gevent._gevent_c_greenlet_primitives, gevent._gevent_c_hub_local, gevent._gevent_c_waiter, gevent._gevent_c_hub_primitives, gevent._gevent_c_ident, gevent._gevent_cgreenlet, gevent._gevent_c_abstract_linkable, gevent._gevent_cevent, gevent._gevent_c_semaphore, gevent._gevent_cqueue, gevent._gevent_c_imap, _brotli, markupsafe._speedups, psycopg2._psycopg, charset_normalizer.md (total: 18)
}}}

Seems hard to debug, but since I'm not doing anything with threads myself, I'm tempted to say this is caused by Django's multi-threaded server.

Why is the Python interpreter being shut down in the first place? It doesn't say... this was during normal operation (perhaps I touched a file and the server restarted? Can't tell).

--
I realize this may not be the best place to open this completely unreproducable ticket, but it's not the worst either... at least it will allow others to find it.

Similar thoughts about this occurring on Django 4.2 and that currently being security-only. I'm just reporting what I found... if it was never fixed, it's probably still around on 5.2"	Bug	closed	Core (Management commands)	4.2	Normal	needsinfo			Unreviewed	0	0	0	0	0	0
