Commit a0661818 authored by Maurits van Rees's avatar Maurits van Rees

In `zc.buildout.testing.system`, set `TERM=dumb` in the environment.

This avoids invisible control characters popping up in some terminals, like `xterm`.

Note that this may affect tests by buildout recipes.
parent 1f14e031
......@@ -4,6 +4,11 @@ Change History
2.5.3 (unreleased)
==================
- In ``zc.buildout.testing.system``, set ``TERM=dumb`` in the environment.
This avoids invisible control characters popping up in some terminals,
like ``xterm``. Note that this may affect tests by buildout recipes.
[maurits]
- Removed Python 2.6 and 3.2 support.
[do3cc]
......
......@@ -110,12 +110,18 @@ def clean_up_pyc(*path):
MUST_CLOSE_FDS = not sys.platform.startswith('win')
def system(command, input='', with_exit_code=False):
# Some TERMinals, expecially xterm and its variants, add invisible control
# characters, which we do not want as they mess up doctests. See:
# https://github.com/buildout/buildout/pull/311
# http://bugs.python.org/issue19884
env = dict(os.environ, TERM='dumb')
p = subprocess.Popen(command,
shell=True,
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
close_fds=MUST_CLOSE_FDS)
close_fds=MUST_CLOSE_FDS,
env=env)
i, o, e = (p.stdin, p.stdout, p.stderr)
if input:
i.write(input.encode())
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment