#36368: `makemessages` command runs `write_po_file()` multiple times for the 
same
potfile
-------------------------------------+-------------------------------------
     Reporter:  Michał Pokusa        |                    Owner:  Michał
                                     |  Pokusa
         Type:  Bug                  |                   Status:  assigned
    Component:  Core (Management     |                  Version:  5.2
  commands)                          |
     Severity:  Normal               |               Resolution:
     Keywords:  makemessages         |             Triage Stage:  Accepted
  write_po_file                      |
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by Natalia Bidart):

 * cc: Claude Paroz (added)
 * easy:  1 => 0
 * stage:  Unreviewed => Accepted

Comment:

 Thank you Michał Pokusa for the test project. I have used that as starting
 point, and I can confirm that there are two places where the files list to
 be processed could have duplicates included. One is where you said:

 {{{#!python
             if self.settings_available:
                 self.locale_paths.extend(settings.LOCALE_PATHS)
 }}}

 But also here, and dupes can be seen when running for example
 `i18n.test_extraction.BasicExtractorTests.test_valid_locale`
 (`locale_paths` end up containing, for example,
 `['/tmp/django__fn2ga0m/i18n_zmigwa3d/commands/locale',
 '/tmp/django__fn2ga0m/i18n_zmigwa3d/commands/locale']`):
 {{{#!python
                 elif dirname == "locale":
                     dirnames.remove(dirname)
                     self.locale_paths.insert(
                         0, os.path.join(os.path.abspath(dirpath), dirname)
                     )
 }}}

 I'm accepting with the goal that we handle duplicates in a way that does
 not alter the order of the locale folders being processed. We need to
 respect the order described in
 [https://docs.djangoproject.com/en/5.2/topics/i18n/translation/#how-
 django-discovers-translations these docs].
-- 
Ticket URL: <https://code.djangoproject.com/ticket/36368#comment:8>
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/01070196a6cf7b69-73e63638-6fb8-4ad1-b45e-feed7053a827-000000%40eu-central-1.amazonses.com.

Reply via email to