#12910: xgettext now required to run tests
------------------------------------+---------------------------------------
          Reporter:  kmtracey       |         Owner:  nobody
            Status:  new            |     Milestone:  1.2   
         Component:  Uncategorized  |       Version:  1.1   
        Resolution:                 |      Keywords:        
             Stage:  Accepted       |     Has_patch:  0     
        Needs_docs:  0              |   Needs_tests:  0     
Needs_better_patch:  0              |  
------------------------------------+---------------------------------------
Comment (by jezdez):

 Replying to [comment:2 ramiro]:
 > Replying to [comment:1 jezdez]:
 > > Hm, does that only occur for Django's tests or for app tests as well?
 >
 > I suspect it is just the Django test suite with our new makemessages
 regression test. I can reproduce this by just running it (it seems there
 are other test failures when `xgettext.exe` does exist too).

 Russ and me we thinking about making the makemessages tests optional just
 like we do with YAML tests for example, e.g. by a conditional import in
 the makemessages/tests.py if a call to xgettext succeeds.

 >
 > And I suspect it could be related to this:
 >
 >  * ''No gettext? If you don't have the gettext utilities installed,
 django-admin.py makemessages will create empty files. If that's the case,
 either install the gettext utilities or just copy the English message file
 (locale/en/LC_MESSAGES/django.po) if available and use it as a starting
 point; it's just an empty translation file.'' (from
 http://docs.djangoproject.com/en/dev/topics/i18n/localization/#topics-
 i18n-localization)
 >
 >  * ''Note: All [os.popen*] functions in this section fail (more or less)
 silently if the executed program cannot be found; this [subprocess] module
 raises an OSError exception. '' (from
 http://docs.python.org/library/subprocess.html#replacing-older-functions-
 with-the-subprocess-module).
 >
 > Summary: The old `os.popen3` simply ignored the condition of a missing
 `xgettext` (or `msgmerge` or `msgfmt`) and we used that to our advantage
 (creating an empty `.po` file). Now `subprocess.Popen()` raises an
 `OSError` exception instead.
 >
 > I had seen this and made a mental note about testing this under win32,
 but forgot to do it later.
 >
 > Problem was I couldn't get `Popen()` to raise that `OSError` under Linux
 when trying to execute a non-existing external command (e.g. `Popen('foo',
 shell=True, stdout=PIPE, stderr=PIPE, close_fds=False,
 universal_newlines=True).communicate()`)

 Oddly enough ``Popen()`` will only raise the OSError for me if I pass it
 ``shell=False``.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/12910#comment:4>
Django <http://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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to