Commits

Lenard Lindstrom committed 3129146

small fixes to get Pygame to pass the unit tests on Windows for Python 3.2

Comments (0)

Files changed (3)

 except NameError:
     raw_input_ = input
 
-if sys.version_info >= (3, 0, 0):
+if sys.platform == 'win32':
+    filesystem_errors = "replace"
+elif sys.version_info >= (3, 0, 0):
     filesystem_errors = "surrogateescape"
 else:
     filesystem_errors = "strict"
 
 /* Defaults for unicode file path encoding */
 #define UNICODE_DEF_FS_CODEC Py_FileSystemDefaultEncoding
+#if defined(MS_WIN32)
+#define UNICODE_DEF_FS_ERROR "replace"
+#else
 #define UNICODE_DEF_FS_ERROR "surrogateescape"
+#endif
 
 #else /* #if PY_VERSION_HEX >= 0x03000000 */
 

test/test_utils/async_sub.py

             c_read = DWORD()
             buffer = ctypes.create_string_buffer(desired_bytes+1)
             success = ctypes.windll.kernel32.ReadFile(handle, buffer, desired_bytes, ctypes.byref(c_read), ol)
-            buffer[c_read.value] = '\0'
+            buffer[c_read.value] = ctypes.c_char(0)
             return ctypes.windll.kernel32.GetLastError(), decode(buffer.value)
         def PeekNamedPipe(handle, desired_bytes):
             c_avail = DWORD()
                 c_read = DWORD()
                 buffer = ctypes.create_string_buffer(desired_bytes+1)
                 success = ctypes.windll.kernel32.PeekNamedPipe(handle, buffer, desired_bytes, ctypes.byref(c_read), ctypes.byref(c_avail), ctypes.byref(c_message))
-                buffer[c_read.value] = '\0'
+                buffer[c_read.value] = ctypes.c_char(0)
                 return decode(buffer.value), c_avail.value, c_message.value
             else:
                 success = ctypes.windll.kernel32.PeekNamedPipe(handle, None, desired_bytes, None, ctypes.byref(c_avail), ctypes.byref(c_message))