MCPcopy Create free account
hub / github.com/ActiveState/code / record

Function record

recipes/Python/577638_File_Share_Messenger_25/recipe-577638.py:1354–1361  ·  view source on GitHub ↗
(stream, path, filename)

Source from the content-addressed store, hash-verified

1352 sys.stderr = orig_stderr
1353
1354def 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

Callers 1

mainFunction · 0.85

Calls 4

openFunction · 0.50
getvalueMethod · 0.45
joinMethod · 0.45
dumpMethod · 0.45

Tested by

no test coverage detected