diff options
| author | Andrew Cordery <cordery@gmail.com> | 2023-11-07 12:32:19 +0100 |
|---|---|---|
| committer | Natalia Bidart <124304+nessita@users.noreply.github.com> | 2023-11-13 14:03:48 -0300 |
| commit | ad41f1c53aa9f2c938df32e4386d8a80138923fc (patch) | |
| tree | e9df9c959dc3aed7f86ff30449921f8732c4579e /django/core/management/commands/compilemessages.py | |
| parent | b863c5ffde0bafa5eaa9f262103eaeb71877787c (diff) | |
Fixed #34952 -- Copied dir list when processing locale folders to avoid missing entries during os.walk traversal.
Co-authored-by: Natalia <124304+nessita@users.noreply.github.com>
Diffstat (limited to 'django/core/management/commands/compilemessages.py')
| -rw-r--r-- | django/core/management/commands/compilemessages.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/django/core/management/commands/compilemessages.py b/django/core/management/commands/compilemessages.py index 9ed3ef7c31..eddf31b794 100644 --- a/django/core/management/commands/compilemessages.py +++ b/django/core/management/commands/compilemessages.py @@ -91,7 +91,8 @@ class Command(BaseCommand): # Walk entire tree, looking for locale directories for dirpath, dirnames, filenames in os.walk(".", topdown=True): - for dirname in dirnames: + # As we may modify dirnames, iterate through a copy of it instead + for dirname in list(dirnames): if is_ignored_path( os.path.normpath(os.path.join(dirpath, dirname)), ignore_patterns ): |
