#23788: Stop templatizing js files for gettext >= 0.18.3
--------------------------------------+------------------------------------
Reporter: claudep | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Internationalization | Version: master
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by timgraham):
* keywords: windows-test-failure =>
* has_patch: 0 => 1
Comment:
It seems this is not actually specific to Windows, but a problem if
`xgettext --version` doesn't have 3 digits (something like 0.17). Care to
improve the regex at all? Not sure if we should try to mock out
`popen_wrapper` to add a test for it.
{{{
diff --git a/django/core/management/commands/makemessages.py
b/django/core/management/commands/makemessages.py
index ba8de52..932bc08 100644
--- a/django/core/management/commands/makemessages.py
+++ b/django/core/management/commands/makemessages.py
@@ -310,9 +310,9 @@ class Command(BaseCommand):
@cached_property
def gettext_version(self):
out, err, status = popen_wrapper(['xgettext', '--version'])
- m = re.search(r'(\d)\.(\d+)\.(\d+)', out)
+ m = re.search(r'(\d)\.(\d+)\.?(\d+)?', out)
if m:
- return tuple(int(d) for d in m.groups())
+ return tuple(int(d) for d in m.groups() if d is not None)
else:
raise CommandError("Unable to get gettext version. Is it
installed?")
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/23788#comment:7>
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 post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/065.a62ecd6f269361b34b4fc5997c4e4cb7%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.