Opened 4 months ago

Closed 21 hours ago

Last modified 21 hours ago

#36434 closed Bug (fixed)

manage.py runserver only respects python -u flag if --noreload is present (-u flag forces streams to be unbuffered)

Reported by: Ivan Owned by: JaeHyuckSa
Component: Core (Management commands) Version: dev
Severity: Normal Keywords: runserver, -u, PYTHONUNBUFFERED
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Ivan)

From python help:

-u     : force the stdout and stderr streams to be unbuffered;
         this option has no effect on stdin; also PYTHONUNBUFFERED=x

Running manage.py runserver only respects python -u flag if --noreload is present, meanwhile setting the environment variable PYTHONUNBUFFERED=1 works fine.

The solution is likely to make sure subprocesses are called with the very same flag.

Change History (12)

comment:1 by Ivan, 4 months ago

Description: modified (diff)

comment:2 by Ivan, 4 months ago

Component: UncategorizedCore (Management commands)

comment:3 by Sarah Boyce, 4 months ago

Triage Stage: UnreviewedAccepted
Version: 5.1dev

Thank you, replicated

comment:4 by myoungjinGo, 4 months ago

Owner: set to myoungjinGo
Status: newassigned

comment:5 by myoungjinGo, 4 weeks ago

Owner: myoungjinGo removed
Status: assignednew

comment:6 by JaeHyuckSa, 4 weeks ago

Owner: set to JaeHyuckSa
Status: newassigned

comment:7 by JaeHyuckSa, 4 weeks ago

Has patch: set

comment:8 by Sarah Boyce, 3 days ago

Needs tests: set

comment:9 by JaeHyuckSa, 3 days ago

Needs tests: unset

comment:10 by Sarah Boyce, 41 hours ago

Triage Stage: AcceptedReady for checkin

comment:11 by Sarah Boyce <42296566+sarahboyce@…>, 21 hours ago

Resolution: fixed
Status: assignedclosed

In 68aae887:

Fixed #36434 -- Preserved unbuffered stdio (-u) in autoreloader child.

Signed-off-by: SaJH <wogur981208@…>

comment:12 by Sarah Boyce <42296566+sarahboyce@…>, 21 hours ago

In db2f206e:

[6.0.x] Fixed #36434 -- Preserved unbuffered stdio (-u) in autoreloader child.

Signed-off-by: SaJH <wogur981208@…>

Backport of 68aae8878ff90dd787db55ecc44ee712525ccdc6 from main.

Note: See TracTickets for help on using tickets.
Back to Top