diff --git a/django/core/management/commands/makemessages.py b/django/core/management/commands/makemessages.py
index 2c6e171..82eacdb 100755
--- a/django/core/management/commands/makemessages.py
+++ b/django/core/management/commands/makemessages.py
@@ -115,7 +115,7 @@ def copy_plural_forms(msgs, locale, domain, verbosity):
 
 def make_messages(locale=None, domain='django', verbosity='1', all=False,
         extensions=None, symlinks=False, ignore_patterns=[], no_wrap=False,
-        no_obsolete=False):
+        no_obsolete=False, keep_pot=False):
     """
     Uses the locale directory from the Django SVN tree or an application/
     project to process all
@@ -201,7 +201,7 @@ def make_messages(locale=None, domain='django', verbosity='1', all=False,
                 msgs, errors = _popen(cmd)
                 if errors:
                     os.unlink(os.path.join(dirpath, thefile))
-                    if os.path.exists(potfile):
+                    if os.path.exists(potfile) and not keep_pot:
                         os.unlink(potfile)
                     raise CommandError(
                         "errors happened while running xgettext on %s\n%s" %
@@ -248,7 +248,7 @@ def make_messages(locale=None, domain='django', verbosity='1', all=False,
                 if errors:
                     if thefile != file:
                         os.unlink(os.path.join(dirpath, thefile))
-                    if os.path.exists(potfile):
+                    if os.path.exists(potfile) and not keep_pot:
                         os.unlink(potfile)
                     raise CommandError(
                         "errors happened while running xgettext on %s\n%s" %
@@ -275,7 +275,8 @@ def make_messages(locale=None, domain='django', verbosity='1', all=False,
             msgs, errors = _popen('msguniq %s --to-code=utf-8 "%s"' %
                                   (wrap, potfile))
             if errors:
-                os.unlink(potfile)
+                if not keep_pot:
+                    os.unlink(potfile)
                 raise CommandError(
                     "errors happened while running msguniq\n%s" % errors)
             if os.path.exists(pofile):
@@ -287,7 +288,8 @@ def make_messages(locale=None, domain='django', verbosity='1', all=False,
                 msgs, errors = _popen('msgmerge %s -q "%s" "%s"' %
                                       (wrap, pofile, potfile))
                 if errors:
-                    os.unlink(potfile)
+                    if not keep_pot:
+                        os.unlink(potfile)
                     raise CommandError(
                         "errors happened while running msgmerge\n%s" % errors)
             elif not invoked_for_django:
@@ -299,7 +301,8 @@ def make_messages(locale=None, domain='django', verbosity='1', all=False,
                 f.write(msgs)
             finally:
                 f.close()
-            os.unlink(potfile)
+            if not keep_pot:
+                os.unlink(potfile)
             if no_obsolete:
                 msgs, errors = _popen('msgattrib %s -o "%s" --no-obsolete "%s"' %
                                       (wrap, pofile, pofile))
@@ -329,6 +332,9 @@ class Command(NoArgsCommand):
             default=False, help="Don't break long message lines into several lines"),
         make_option('--no-obsolete', action='store_true', dest='no_obsolete',
             default=False, help="Remove obsolete message strings"),
+        make_option('--keep-pot', action='store_true', dest='keep_pot',
+            default=False, help="Keep .pot file after making messages. Useful when debugging."),
+
     )
     help = ( "Runs over the entire source tree of the current directory and "
 "pulls out all strings marked for translation. It creates (or updates) a message "
@@ -352,6 +358,7 @@ class Command(NoArgsCommand):
         ignore_patterns = list(set(ignore_patterns))
         no_wrap = options.get('no_wrap')
         no_obsolete = options.get('no_obsolete')
+        keep_pot = options.get('keep_pot')
         if domain == 'djangojs':
             extensions = handle_extensions(extensions or ['js'])
         else:
@@ -361,4 +368,4 @@ class Command(NoArgsCommand):
             sys.stdout.write('examining files with the extensions: %s\n'
                              % get_text_list(list(extensions), 'and'))
 
-        make_messages(locale, domain, verbosity, process_all, extensions, symlinks, ignore_patterns, no_wrap, no_obsolete)
+        make_messages(locale, domain, verbosity, process_all, extensions, symlinks, ignore_patterns, no_wrap, no_obsolete, keep_pot)
diff --git a/docs/ref/django-admin.txt b/docs/ref/django-admin.txt
index c07b61c..0dfd325 100755
--- a/docs/ref/django-admin.txt
+++ b/docs/ref/django-admin.txt
@@ -475,6 +475,14 @@ Use the ``--no-default-ignore`` option to disable the default values of
 Use the ``--no-wrap`` option to disable breaking long message lines into
 several lines in language files.
 
+.. django-admin-option:: --keep-pot
+
+.. versionadded:: 1.4
+
+Use the ``--keep-pot`` option to prevent django from deleting the temporary .pot file
+it generates before creating the .po file. This is useful for debugging errors which
+may prevent the final language files from being created.
+
 reset <appname appname ...>
 ---------------------------
 
