Commits

Anonymous committed 711e276

Open files as binary (required for Windows support).

Comments (0)

Files changed (1)

biplist/__init__.py

     didOpen = False
     result = None
     if isinstance(pathOrFile, (str, unicode)):
-        pathOrFile = open(pathOrFile)
+        pathOrFile = open(pathOrFile, 'rb')
         didOpen = True
     try:
         reader = PlistReader(pathOrFile)
     else:
         didOpen = False
         if isinstance(pathOrFile, (str, unicode)):
-            pathOrFile = open(pathOrFile, 'w')
+            pathOrFile = open(pathOrFile, 'wb')
             didOpen = True
         writer = PlistWriter(pathOrFile)
         result = writer.writeRoot(rootObject)