pmtest: set LC_ALL=C in subprocess.call
LC_ALL=C is required to force pacman's output to English for tests that rely on that output, but setting it in Makefile.am results in those tests breaking under different locales when pactest.py is run directly. This will also ease an eventual transition to python3 which LC_ALL=C causes to default to ascii encoded strings, creating problems for tests with unicode strings. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
parent
84ac55b052
commit
296e630edd
2 changed files with 2 additions and 2 deletions
|
@ -27,7 +27,7 @@ dist_pkgdata_DATA = \
|
|||
check-local: test-pacman test-pacsort test-vercmp test-parseopts
|
||||
|
||||
test-pacman: test/pacman src/pacman
|
||||
LC_ALL=C $(PYTHON) $(top_srcdir)/test/pacman/pactest.py --debug=1 \
|
||||
$(PYTHON) $(top_srcdir)/test/pacman/pactest.py --debug=1 \
|
||||
--test $(top_srcdir)/test/pacman/tests/*.py \
|
||||
--scriptlet-shell $(SCRIPTLET_SHELL) \
|
||||
--ldconfig $(LDCONFIG) \
|
||||
|
|
|
@ -241,7 +241,7 @@ class pmtest(object):
|
|||
# archives are made available more easily.
|
||||
time_start = time.time()
|
||||
self.retcode = subprocess.call(cmd, stdout=output, stderr=output,
|
||||
cwd=os.path.join(self.root, util.TMPDIR))
|
||||
cwd=os.path.join(self.root, util.TMPDIR), env={'LC_ALL': 'C'})
|
||||
time_end = time.time()
|
||||
vprint("\ttime elapsed: %.2fs" % (time_end - time_start))
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue