Commits

clach04 committed 1c57087 Draft Merge

Merge binary fix into qrcode

Comments (0)

Files changed (1)

       for suffix in ["", ".1", ".2", ".3", ".4", ".5", ".6", ".7", ".8", ".9"]:
          destfilename = os.path.join (".", upfilename + suffix)
          try:
-            destfile = os.open (destfilename, os.O_BINARY |os.O_WRONLY | os.O_CREAT | os.O_EXCL, 0644)
+            open_flags = os.O_WRONLY | os.O_CREAT | os.O_EXCL
+            if hasattr(os, 'O_BINARY'):
+               open_flags |= os.O_BINARY
+            destfile = os.open (destfilename, open_flags, 0644)
             break
          except OSError, e:
             if e.errno == errno.EEXIST: