[Python-bugs-list] [ python-Bugs-633480 ] IOError w/ large string to CMD shell

noreply@sourceforge.net noreply@sourceforge.net
Mon, 04 Nov 2002 13:06:22 -0800


Bugs item #633480, was opened at 2002-11-04 16:06
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=633480&group_id=5470

Category: Windows
Group: Python 2.2.1
Status: Open
Resolution: None
Priority: 5
Submitted By: Michael McCandless (mikemccand)
Assigned to: Tim Peters (tim_one)
Summary: IOError w/ large string to CMD shell

Initial Comment:

If I try to run this program with "python2.2.1 -u":

  # 61409 works!!
  print ' ' * 61410

(which tries to print a string of 61,410 space characters), 
I get this Traceback on Windows 2000 SP2:

  Traceback (most recent call last):
    File "write.py", line 4, in ?
      print ' ' * 61410
  IOError: [Errno 12] Not enough space

Without "-u", this runs fine, and if I change "print" 
to "import sys; sys.stdout.write" instead, it still fails.

I think this is happening in Objects/fileobject.c -- the 
calls to fwrite apparently don't write all bytes in win32 
when the number of bytes is large -- seems like it may 
be necessary to parcel the data up into smaller pieces 
or something?

NOTE: it's possible that the exact length of the string 
that fails may be larger on other OS's...

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=633480&group_id=5470