--- a/mercurial/statprof.py Wed Dec 04 22:02:36 2024 -0500
+++ b/mercurial/statprof.py Wed Dec 04 22:07:56 2024 -0500
@@ -384,7 +384,7 @@
def save_data(path):
- with open(path, 'w+') as file:
+ with open(path, 'w+b') as file:
file.write(b"%f %f\n" % state.accumulated_time)
for sample in state.samples:
time = sample.time
@@ -830,7 +830,7 @@
fd, path = pycompat.mkstemp()
- with open(path, "w+") as file:
+ with open(path, "w+b") as file:
for line, count in lines.items():
file.write(b"%s %d\n" % (line, count))