File tree Expand file tree Collapse file tree 2 files changed +5
-0
lines changed Expand file tree Collapse file tree 2 files changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,8 @@ Unreleased
19
19
- ``LocalProxy.__wrapped__ `` is always set to the wrapped object when
20
20
the proxy is unbound, fixing an issue in doctest that would cause it
21
21
to fail. :issue: `2485 `
22
+ - Address one ``ResourceWarning `` related to the socket used by
23
+ ``run_simple ``. :issue: `2421 `
22
24
23
25
24
26
Version 2.2.1
Original file line number Diff line number Diff line change @@ -1061,6 +1061,9 @@ def run_simple(
1061
1061
if not is_running_from_reloader ():
1062
1062
s = prepare_socket (hostname , port )
1063
1063
fd = s .fileno ()
1064
+ # Silence a ResourceWarning about an unclosed socket. This object is no longer
1065
+ # used, the server will create another with fromfd.
1066
+ s .detach ()
1064
1067
os .environ ["WERKZEUG_SERVER_FD" ] = str (fd )
1065
1068
else :
1066
1069
fd = int (os .environ ["WERKZEUG_SERVER_FD" ])
You can’t perform that action at this time.
0 commit comments