Opened 11 years ago
Last modified 11 years ago
#24500 closed Bug
Django runtests - 3 tests fail on windows due to encoding troubles — at Initial Version
| Reported by: | pascal chambon | Owned by: | nobody |
|---|---|---|---|
| Component: | Internationalization | Version: | 1.8rc1 |
| Severity: | Release blocker | Keywords: | |
| Cc: | Claude Paroz | 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
On a my python2.7.3 install (32 bits), a today's checkout of django's master doesn't pass all tests - three i18n tests fails due to UnicodeDecodeError.
I'm aware it might be due to locales (https://docs.djangoproject.com/en/dev/internals/contributing/writing-code/unit-tests/#many-test-failures-with-unicodeencodeerror), but windows doesn't have such packages that I'm aware of.
My win32 "xgettext --version" is "xgettext (GNU gettext-tools) 0.17"
I've followed the bug down to the xgettext invocation, where it seems the test expects utf8 output, whereas my xgettext-win32 version of course outputs ANSI (french locale) text.
UnicodeDecodeError('utf8', "xgettext (GNU gettext-tools) 0.17\nCopyright (C) 1995-1998, 2000-2007 Free Software Foundation, Inc.\nLicence GPLv3+ : GNU GPL version 3 ou ult\xe9rieure <http://gnu.org/licenses/gpl.html>\nCeci est un logiciel libre : vous pouvez le modifier et le redistribuer.\nIl n'y a PAS DE GARANTIE, dans la mesure de ce que permet la loi.\n\xc9crit par Ulrich
Drepper.\n", 141, 142, 'invalid continuation byte')
Are these tests supposed to pass on windows as well as on *nix systems ? Are there specific requirements regarding xgettext or third-party packages ?
examining files with the extensions: .js
ignoring file code.sample in .
ignoring file not_utf8.sample in .
ignoring file __init__.py in .
ignoring file ignored.html in .\ignore_dir
ignoring file media_ignored.html in .\media_root
ignoring file static_ignored.html in .\static
ignoring file comments.thtml in .\templates
ignoring file empty.html in .\templates
ignoring file plural.djtpl in .\templates
ignoring file template_with_error.tpl in .\templates
ignoring file test.html in .\templates
ignoring file xxx_ignored.html in .\templates
ignoring file ignored.html in .\templates\subdir
processing file javascript.js in .
UnicodeDecodeError: skipped file javascript.js in .
processing file javascript.js in .\someapp\static
UnicodeDecodeError: skipped file javascript.js in .\someapp\static
processing file javascript_ignored.js in .\static
UnicodeDecodeError: skipped file javascript_ignored.js in .\static
processing locale de
======================================================================
FAIL: test_default_root_settings (i18n.test_extraction.JavascriptExtractorTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "P:\Websites\django\django\test\utils.py", line 180, in inner
return test_func(*args, **kwargs)
File "P:\Websites\django\tests\i18n\test_extraction.py", line 454, in test_default_root_settings
_, po_contents = self._run_makemessages(domain='djangojs')
File "P:\Websites\django\tests\i18n\test_extraction.py", line 67, in _run_makemessages
self.assertTrue(os.path.exists(self.PO_FILE))
AssertionError: False is not true
======================================================================
FAIL: test_javascript_literals (i18n.test_extraction.JavascriptExtractorTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "P:\Websites\django\tests\i18n\test_extraction.py", line 422, in test_javascript_literals
_, po_contents = self._run_makemessages(domain='djangojs')
File "P:\Websites\django\tests\i18n\test_extraction.py", line 67, in _run_makemessages
self.assertTrue(os.path.exists(self.PO_FILE))
AssertionError: False is not true
======================================================================
FAIL: test_media_static_dirs_ignored (i18n.test_extraction.JavascriptExtractorTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "P:\Websites\django\django\test\utils.py", line 180, in inner
return test_func(*args, **kwargs)
File "P:\Websites\django\tests\i18n\test_extraction.py", line 445, in test_media_static_dirs_ignored
_, po_contents = self._run_makemessages(domain='djangojs')
File "P:\Websites\django\tests\i18n\test_extraction.py", line 67, in _run_makemessages
self.assertTrue(os.path.exists(self.PO_FILE))
AssertionError: False is not true