Files opened on Windows in mode 'wb' have a limit on the number of characters that can be written to them (at once?); attempting to write too many bytes gives the confusing error “IOError: [Errno 22] Invalid argument”. See http://support.microsoft.com/default.aspx?scid=kb;en-us;899149 and http://stackoverflow.com/questions/4226941/python-ioerror-errno-22-invalid-argument-when-using-cpickle-to-write-large. I have gotten this error when using subprocess.communicate(input=<large string>). Please fix the subprocess library (and any other library that uses mode 'wb') to use mode 'w+b', at least on Windows. |