Opened 13 months ago

Closed 13 months ago

Last modified 13 months ago

#23298 closed Bug (fixed)

Makemessages --ignore option doesn't work for directories under Windows

Reported by: ramiro Owned by: nobody
Component: Internationalization Version: 1.7-rc-2
Severity: Release blocker Keywords: makemessages windows win32 --ignore ignore
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by ramiro)

When running the i18n.test_extraction tests under Windows, the following failures happen:

======================================================================
FAIL: test_ignore_subdirectory (i18n.test_extraction.IgnoredExtractorTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "D:\ramiro\django\upstream\tests\i18n\test_extraction.py", line 387, in test_ignore_subdirectory
    self.assertTrue("ignoring directory subdir" in out)
AssertionError: False is not true

======================================================================
FAIL: test_media_static_dirs_ignored (i18n.test_extraction.IgnoredExtractorTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "d:\ramiro\django\upstream\django\test\utils.py", line 281, in inner
    return test_func(*args, **kwargs)
  File "D:\ramiro\django\upstream\tests\i18n\test_extraction.py", line 402, in test_media_static_dirs_ignored
    self.assertIn("ignoring directory static_root", out)
AssertionError: u'ignoring directory static_root' not found in 'examining files with the extensions: .html and .txt\nprocessing file __init__.py in .\nprocessing file code.sample in .\nprocessing file ignored.html in .\\ignore_dir\nprocessing file ja
vascript.js in .\nprocessing file media_ignored.html in .\\media_root\nprocessing file not_utf8.sample in .\nprocessing file static_ignored.html in .\\static_root\nprocessing file comments.thtml in .\\templates\nprocessing file empty.html in .\\templ
ates\nprocessing file plural.djtpl in .\\templates\nprocessing file ignored.html in .\\templates\\subdir\nprocessing file template_with_error.tpl in .\\templates\nprocessing file test.html in .\\templates\nprocessing file xxx_ignored.html in .\\templ
ates\nprocessing locale de\ncopying plural forms: "Plural-Forms: nplurals=2; plural=(n != 1);\\n"\n'

----------------------------------------------------------------------
Ran 34 tests in 5.670s

FAILED (failures=2)

This is caused because code is trying to perform matching of dirs specs with a trailing '/*' but the path representation it uses at that point is in native format (using '\' path separators).

Refs #20422
Refs #22336

Change History (7)

comment:1 Changed 13 months ago by ramiro

  • Has patch set
  • Keywords makemessages windows win32 --ignore ignore added

comment:2 Changed 13 months ago by ramiro

  • Description modified (diff)

comment:3 Changed 13 months ago by ramiro

Note: To see the test failures, gettext needs to be installed. Otherwise these tests are skipped.

comment:4 Changed 13 months ago by timgraham

  • Severity changed from Normal to Release blocker
  • Triage Stage changed from Unreviewed to Ready for checkin
  • Version changed from master to 1.7-rc-2

comment:5 Changed 13 months ago by Ramiro Morales <ramiro@…>

  • Resolution set to fixed
  • Status changed from new to closed

In b4dce7c37ab7666b023ac791d2c46dad6c8aa637:

Fixed #23298 -- Made makemessages actually ignore specified dirs on Windows.

This was detected by two failures in the i18n.test_extraction of our
test suite.

Refs #20422, refs #22336

comment:6 Changed 13 months ago by Ramiro Morales <ramiro@…>

In 152afadef12e3dcb9ce92567d2e58269749d63b9:

Merge pull request #3075 from ramiro/makemessages-ignore-windows

Fixed #23298 -- Made makemessages actually ignore specified dirs on Wind...

comment:7 Changed 13 months ago by Tim Graham <timograham@…>

In 126606c5b8499830cd56cbe632f6af17bc7471ea:

[1.7.x] Fixed #23298 -- Made makemessages actually ignore specified dirs on Windows.

This was detected by two failures in the i18n.test_extraction of our
test suite.

Refs #20422, refs #22336

Backport of b4dce7c37a from master

Note: See TracTickets for help on using tickets.
Back to Top