mercurial/statprof.py
changeset 52377 ef83646d5f7d
parent 52376 9b43246e710e
child 52580 f4d1f0713b49
--- 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))