#36376: Use argparse color on Python 3.14+
-------------------------------------+-------------------------------------
     Reporter:  Adam Johnson         |                     Type:
                                     |  Uncategorized
       Status:  new                  |                Component:  Core
                                     |  (Management commands)
      Version:  dev                  |                 Severity:  Normal
     Keywords:  6.1                  |             Triage Stage:
                                     |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
 Python 3.14 introduces colorized help to argparse:
 https://docs.python.org/3.14/library/argparse.html#color

 I propose that we enable this attribute for all argument parsers in
 Django, notably for management commands.

 Python supports common opt-out environment variables for the feature. I
 think we’ll need to extend that to also avoid setting the `color`
 attribute when `DJANGO_COLORS` is set to `nocolor`,
 [https://docs.djangoproject.com/en/5.2/ref/django-admin/#syntax-coloring
 as already documented].

 We may also be able to set the option when
 [https://docs.djangoproject.com/en/5.2/ref/django-admin/#cmdoption-force-
 color `--force-color`] is passed, although that may not make sense when
 `--help` is passed.

 Related: #36321
-- 
Ticket URL: <https://code.djangoproject.com/ticket/36376>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/django-updates/01070196af6a396f-f08d35df-d45f-4d50-8819-aa2b03ee815c-000000%40eu-central-1.amazonses.com.

Reply via email to