Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 730b81c

Browse files
committed
Add debugging print for test failure on Windows
1 parent 9d42bcb commit 730b81c

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

IPython/testing/tools.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,11 @@ def ipexec(fname, options=None, commands=()):
218218
full_cmd = ipython_cmd + cmdargs + [full_fname]
219219
env = os.environ.copy()
220220
env.pop('PYTHONWARNINGS', None) # Avoid extraneous warnings appearing on stderr
221+
for k, v in env.items():
222+
# Debug a bizarre failure we've seen on Windows:
223+
# TypeError: environment can only contain strings
224+
if not isinstance(v, str):
225+
print(v)
221226
p = Popen(full_cmd, stdout=PIPE, stderr=PIPE, stdin=PIPE, env=env)
222227
out, err = p.communicate(input=py3compat.str_to_bytes('\n'.join(commands)) or None)
223228
out, err = py3compat.bytes_to_str(out), py3compat.bytes_to_str(err)

0 commit comments

Comments
 (0)