Vinay Sajip <vinay_sa...@yahoo.co.uk> added the comment: David, I don't think it's that - I think it's the subprocess comms. This works:
def _do_test(self, program, exc_text): with open(self.testfn, 'w') as testmod: testmod.writelines(program.format( exception_action=self.exception_action)) p = subprocess.Popen([sys.executable, 'testmod.py'], stderr=subprocess.PIPE) streams = p.communicate() v1 = streams[1].decode('utf-8') # this shouldn't be hardcoded! v2 = exc_text.format(exception_action=self.exception_action) self.assertEqual(v1, v2) But I don't think the 'utf-8' encoding should be hardcoded. Not sure what to use - sys.getfilesystemencoding()? locale.getpreferredencoding()? Decisions, decisions :-( ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue1553375> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com