[ python-Bugs-1189525 ] file.write(x) where len(x) > 64*1024**2 is unreliable

SourceForge.net noreply at sourceforge.net
Mon Apr 25 18:48:06 CEST 2005


Bugs item #1189525, was opened at 2005-04-25 10:51
Message generated for change (Comment added) made by tim_one
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1189525&group_id=5470

Category: Windows
>Group: 3rd Party
>Status: Closed
>Resolution: Wont Fix
Priority: 5
Submitted By: Martin Gfeller (gfe)
Assigned to: Nobody/Anonymous (nobody)
Summary: file.write(x) where len(x) > 64*1024**2 is unreliable

Initial Comment:
Large file writes (over 64MB) are unreliable under 
Windows.

On my Windows 2000 SP4, it succeeds when writing to 
a file on a local driver, or on a network drive.

Howver, if I map the share of the local drive c$ as 
another drive, the same write fails with:

IOError: [Errno 22] Invalid argument


Filemon (www.sysinternals.com) shows that this is a 
STATUS_INSUFFICIENT_RESOURCES returned by 
IRP_MJ_WRITE.

Although this is probably a Windows bug, my 
suggestion is that Python should abstract from such 
problems, and break the writes into suitable chunks.

Best regards,
Martin 

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

>Comment By: Tim Peters (tim_one)
Date: 2005-04-25 12:48

Message:
Logged In: YES 
user_id=31435

Python's file.write() just calls the platform C's fwrite(), and 
MS's fwrite() docs don't admit to any size limitations.

If this is a documented bug on Windows, then your complaint 
is with Microsoft.

If it's not documented, how is anyone supposed to guess 
what "suitable" means in all cases?

IOW, this report is either misdirected, or impossible to fix 
sanely.  Sorry, but I'm closing as "3rd Party, WontFix" on 
these grounds.

If you care enough to research it in depth and create a patch, 
that may be a different story.

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

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


More information about the Python-bugs-list mailing list