﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
24384	compilemessages shouldn't return with exit code 0 when it fails	Aymeric Augustin	Claude Paroz	"When compilemessages is run on a read-only location, it displays a messages to standard error and terminates with exit code 0. It should have exit code 1.

Patch:

{{{
diff --git a/django/core/management/commands/compilemessages.py b/django/core/management/commands/compilemessages.py
index dbadac0..75f3c57 100644
--- a/django/core/management/commands/compilemessages.py
+++ b/django/core/management/commands/compilemessages.py
@@ -108,9 +108,9 @@ class Command(BaseCommand):
 
             # Check writability on first location
             if i == 0 and not is_writable(npath(base_path + '.mo')):
-                self.stderr.write(""The po files under %s are in a seemingly not writable location. ""
-                                  ""mo files will not be updated/created."" % dirpath)
-                return
+                raise CommandError(""The po files under %s are in a seemingly ""
+                                   ""not writable location. mo files will not ""
+                                   ""be updated/created."" % dirpath)
 
             args = [self.program] + self.program_options + ['-o',
                     npath(base_path + '.mo'), npath(base_path + '.po')]
}}}

With this change, the output is exactly the same, but the exit code reflects the failure and the --traceback option works.

I don't quite have the motivation to write tests for this change :-/"	Bug	closed	Internationalization	dev	Normal	fixed			Ready for checkin	1	0	0	0	0	0
