[Django] #35504: Bug running test i18n.test_extraction.UnchangedPoExtractionTests on WSL cause of CRLF/LF issue

8 views
Skip to first unread message

Django

unread,
Jun 8, 2024, 5:56:41 AM6/8/24
to django-...@googlegroups.com
#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.

Django

unread,
Jun 12, 2024, 9:54:30 AM6/12/24
to django-...@googlegroups.com
#35504: Bug running test i18n.test_extraction.UnchangedPoExtractionTests on WSL
cause of CRLF/LF issue
-------------------------------------+-------------------------------------
Reporter: gaweng | Owner: nobody
Type: Bug | Status: closed
Component: Testing framework | Version: dev
Severity: Normal | Resolution: invalid
Keywords: PoExtraction, WSL, | Triage Stage:
Test | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Sarah Boyce):

* resolution: => invalid
* status: new => closed

Comment:

These tests work in Windows and I think running the Django test suite in
WSL is quite niche and so I wouldn't track this with a ticket.
If you have a nice way to resolve this feel free to submit a PR 👍
--
Ticket URL: <https://code.djangoproject.com/ticket/35504#comment:1>
Reply all
Reply to author
Forward
0 new messages