Check in Daniel Stutzbach's _fileio.c and test_fileio.py
(see SF#1671314) with small tweaks.
The io module now uses this instead of its own implementation
of the FileIO class, if it can import _fileio.
diff --git a/setup.py b/setup.py
index 3417865..573fba2 100644
--- a/setup.py
+++ b/setup.py
@@ -1037,6 +1037,9 @@
         # Thomas Heller's _ctypes module
         self.detect_ctypes(inc_dirs, lib_dirs)
 
+        # _fileio -- supposedly cross platform
+        exts.append(Extension('_fileio', ['_fileio.c']))
+
         # Platform-specific libraries
         if platform == 'linux2':
             # Linux-specific modules