Message118287
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 :-( |
|
Date |
User |
Action |
Args |
2010-10-09 19:04:11 | vinay.sajip | set | recipients:
+ vinay.sajip, guettli, hoffman, ggenellina, pakal, r.david.murray, news1234, ysj.ray |
2010-10-09 19:04:11 | vinay.sajip | set | messageid: <1286651051.45.0.355648146933.issue1553375@psf.upfronthosting.co.za> |
2010-10-09 19:04:10 | vinay.sajip | link | issue1553375 messages |
2010-10-09 19:04:09 | vinay.sajip | create | |
|