#35504: Bug running test i18n.test_extraction.UnchangedPoExtractionTests on WSL
cause of CRLF/LF issue
-------------------------------------+-------------------------------------
Reporter: gaweng | Owner: nobody
Type: Bug | Status: new
Component: Testing | Version: dev
framework | Keywords: PoExtraction, WSL,
Severity: Normal | Test
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
Bug is only occurs in WSL.
Steps to reproduce:
- creating an venv
- cloning the repo and installing all dependencies
- run test i18n.test_extraction.UnchangedPoExtractionTests
Reason:
The failure is causing CRLF on Windows System but running the tests in WSL
expecting LF, so the po file is regenerated and the date doesn't match.
Workaround:
You can change django.po.tmp file to LF Line endings, than tests run
without errors.
Alternatively, you also can change the line ending to LF in git. But than
it's also LF if you're using it in windows environment with powershell.
Error-Message:
{{{
.F
======================================================================
FAIL: test_po_remains_unchanged
(i18n.test_extraction.UnchangedPoExtractionTests)
PO files are unchanged unless there are new changes.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/mnt/c/git/contributing/django/tests/i18n/test_extraction.py",
line 1086, in test_po_remains_unchanged
self.assertEqual(po_contents, self.original_po_contents)
AssertionError: '# SO[187 chars]R.\n# \n#, fuzzy\nmsgid ""\nmsgstr
""\n"Projec[580 chars]."\n' != '# SO[187 chars]R.\n#\n#, fuzzy\nmsgid
""\nmsgstr ""\n"Project[579 chars]."\n'
Diff is 971 characters long. Set self.maxDiff to None to see it.
----------------------------------------------------------------------
Ran 2 tests in 0.159s
}}}
Comment on Error-Message:
The error message is only referring on the new generated po file, cause it
doesn't looks equal for gettext cause of CRLF instead of LF
--
Ticket URL: <
https://code.djangoproject.com/ticket/35504>
Django <
https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.