This will cause compilemessages to accidentally ignore a locale directory
that directly follows a skipped directory in the list. Unfortunately it
is not easy to predict when this will occur or which directories may be
affected as os.walk provides the list of dirnames in 'arbitrary' order
according to the python docs.
I've provided the miniscule patch to fix this as well as a much lengthier
regression test, however I'm not positive that the test is capable of
recreating the correct conditions on all operating systems. I've tested
on OSX only. Regardless, the issue at hand is a basic language error
(modifying a value that you are iterating through) and the fix is
extremely simple (i.e. copy dirnames before iterating, in my patch I just
wrap it in list()), so this should not be a controversial patch.
Note: this was originally mentioned as a comment on my other ticket
https://code.djangoproject.com/ticket/34925, I'm separating it for clarity
and I will attach the PR here.
--
Ticket URL: <https://code.djangoproject.com/ticket/34952>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
Comment (by Andrew Cordery):
Here is the PR: https://github.com/django/django/pull/17452
--
Ticket URL: <https://code.djangoproject.com/ticket/34952#comment:1>
* component: Uncategorized => Internationalization
* stage: Unreviewed => Accepted
Comment:
Thank you! Accepting.
--
Ticket URL: <https://code.djangoproject.com/ticket/34952#comment:2>
* owner: nobody => Andrew Cordery
* needs_better_patch: 0 => 1
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/34952#comment:3>
* stage: Accepted => Ready for checkin
--
Ticket URL: <https://code.djangoproject.com/ticket/34952#comment:4>
* status: assigned => closed
* needs_better_patch: 1 => 0
* resolution: => fixed
Comment:
Fixed by ad41f1c53aa9f2c938df32e4386d8a80138923fc.
--
Ticket URL: <https://code.djangoproject.com/ticket/34952#comment:5>