Commits

Miks Kalniņš  committed cc7067f

Windows support for moin load/save, fixes #66 "test moin load/save on windows, fix if needed"'

  • Participants
  • Parent commits 8fa27ec

Comments (0)

Files changed (1)

File MoinMoin/script/maint/serialization.py

 
     def run(self, filename=None):
         if filename is None:
+            # On Windows force the stdout to be in binary mode.
+            if sys.platform == "win32":
+                import os, msvcrt
+                msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
+
             f = sys.stdout
         else:
             f = open(filename, "wb")
 
     def run(self, filename=None):
         if filename is None:
+            # On Windows force the stdin to be in binary mode.
+            if sys.platform == "win32":
+                import os, msvcrt
+                msvcrt.setmode(sys.stdin.fileno(), os.O_BINARY)
+
             f = sys.stdin
         else:
             f = open(filename, "rb")