#35308: FileNotFoundError escapes from run_formatters()
-------------------------------------+-------------------------------------
     Reporter:  Jacob Walls          |                    Owner:  nobody
         Type:                       |                   Status:  new
  Cleanup/optimization               |
    Component:  Core (Management     |                  Version:  dev
  commands)                          |
     Severity:  Normal               |               Resolution:
     Keywords:  black, code          |             Triage Stage:  Accepted
  formatting                         |
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by Natalia Bidart):

 * component:  Uncategorized => Core (Management commands)
 * keywords:  black => black, code formatting
 * stage:  Unreviewed => Accepted
 * type:  Bug => Cleanup/optimization
 * version:  4.2 => dev

Comment:

 I can see value in handling these two exceptions (even in Linux):

 * `PermissionError`: somehow the path is not executable or can not be read
 by the user executing the formatting.
 * `FileNotFoundError`: black path disappeared between it was calculated by
 `shutil.which` and it was executed by `subprocess.run` (disk full, version
 upgrade, etc).

 As long as we log the fact that we were about to run `black` but we
 couldn't, I think this is a welcomed improvement. Accepting on that basis
 (follow up of #33476).
-- 
Ticket URL: <https://code.djangoproject.com/ticket/35308#comment:4>
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 on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018e56faf202-156fc4e7-16e4-4538-ba1c-a23459e8f526-000000%40eu-central-1.amazonses.com.

Reply via email to