Fixed #26673 -- Fixed a I18N test case error on Windows+Python 2.7.

`subprocess.Popen` doesn't accept enviroment vars with Unicode var name
or value.
This commit is contained in:
Ramiro Morales 2016-05-27 20:45:37 -03:00
parent a4c20ae85b
commit 15a5755e7c
1 changed files with 1 additions and 1 deletions

View File

@ -171,7 +171,7 @@ class CompilationErrorHandling(MessageCompilationTests):
self.addCleanup(self.rmfile, os.path.join(self.test_dir, mo_file)) self.addCleanup(self.rmfile, os.path.join(self.test_dir, mo_file))
# Make sure the output of msgfmt is unaffected by the current locale. # Make sure the output of msgfmt is unaffected by the current locale.
env = os.environ.copy() env = os.environ.copy()
env.update({'LANG': 'C'}) env.update({str('LANG'): str('C')})
with mock.patch('django.core.management.utils.Popen', lambda *args, **kwargs: Popen(*args, env=env, **kwargs)): with mock.patch('django.core.management.utils.Popen', lambda *args, **kwargs: Popen(*args, env=env, **kwargs)):
if six.PY2: if six.PY2:
# Various assertRaises on PY2 don't support unicode error messages. # Various assertRaises on PY2 don't support unicode error messages.