Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#19584 closed Bug (fixed)

compilemessages does not report error when msgfmt fails or is missing

Reported by: Kevin Michel Owned by: nobody
Component: Internationalization Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

compile_messages does not check and propagate the return code of the os.system call to msgfmt :

https://github.com/django/django/blob/master/django/core/management/commands/compilemessages.py#L51

A quick grep tells that it's the only unchecked usage of os.system in Django.

Change History (4)

comment:1 by Claude Paroz, 12 years ago

Component: TranslationsInternationalization
Triage Stage: UnreviewedAccepted

comment:2 by Ramiro Morales, 12 years ago

Last edited 12 years ago by Ramiro Morales (previous) (diff)

comment:3 by Ramiro Morales <cramm0@…>, 12 years ago

Resolution: fixed
Status: newclosed

In dfa9324966ce1a38346d15e35805d042848aabf1:

Don't use os.system() in compilemessages.

Fixes #19584.

This implies stop storing file path command line arguments in envvars as
a security measure to start relying on with Popen's shell=False instead,
and addition of an 'utils' module.

Thanks kmichel_wgs for the report.

comment:4 by Ramiro Morales <cramm0@…>, 12 years ago

In 7fca4416c7f7ce66d528f0d1ad829cf3b8290b89:

Made (make|compile)messages check for availability of gettext commands.

Refs #19584.

Note: See TracTickets for help on using tickets.
Back to Top