(stream, path, filename)
| 1352 | sys.stderr = orig_stderr |
| 1353 | |
| 1354 | def record(stream, path, filename): |
| 1355 | # Find out if there were any errors during execution. |
| 1356 | errors = stream.getvalue() |
| 1357 | if errors: |
| 1358 | # Save them to a pickled file with a timestamp. |
| 1359 | with open(os.path.join(path, filename), 'ab', 0) as file: |
| 1360 | problem = getpass.getuser(), datetime.datetime.utcnow(), errors |
| 1361 | pickle.dump(problem, file) |
| 1362 | |
| 1363 | ################################################################################ |
| 1364 |