From 6310d658b7c8a39747a8cda3e3b8716266cffb0d Mon Sep 17 00:00:00 2001 From: Claude Paroz Date: Sat, 30 Nov 2013 11:30:56 +0100 Subject: [PATCH] Closed file after reading pot file Faulty line was introduced in 50a8ab7cd1. --- django/core/management/commands/makemessages.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/django/core/management/commands/makemessages.py b/django/core/management/commands/makemessages.py index 4994aaf6baa..a42ba964443 100644 --- a/django/core/management/commands/makemessages.py +++ b/django/core/management/commands/makemessages.py @@ -402,7 +402,8 @@ class Command(NoArgsCommand): elif self.verbosity > 0: self.stdout.write(errors) else: - msgs = open(potfile, 'r').read() + with open(potfile, 'r') as fp: + msgs = fp.read() if not self.invoked_for_django: msgs = self.copy_plural_forms(msgs, locale) msgs = msgs.replace(