[Python-bugs-list] [ python-Bugs-623464 ] tempfile crashes

noreply@sourceforge.net noreply@sourceforge.net
Mon, 04 Nov 2002 12:58:07 -0800


Bugs item #623464, was opened at 2002-10-15 05:54
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=623464&group_id=5470

Category: Windows
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Thomas Heller (theller)
Assigned to: Thomas Heller (theller)
Summary: tempfile crashes

Initial Comment:
tempfile.NamedTemporaryFile(".zip") crashes with an 
access violation. Win2k, SP2.


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

>Comment By: Neal Norwitz (nnorwitz)
Date: 2002-11-04 15:58

Message:
Logged In: YES 
user_id=33168

Sounds good to me.  Care to work on a patch with tests?  

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

Comment By: Thomas Heller (theller)
Date: 2002-11-04 15:36

Message:
Logged In: YES 
user_id=11105

IMO we should check for a valid mode. There is a large 
surprise if python crashes with an access violation when the 
innocent user does innocent things like this. But this is just 
*my* opinion.

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

Comment By: Neal Norwitz (nnorwitz)
Date: 2002-11-02 15:53

Message:
Logged In: YES 
user_id=33168

We don't check anywhere else for valid mode chars.  We would
have to fix Modules/posixmodule.c and Modules/socketmodule
if we wanted to check.  Thomas, do you think a checks should
be added or close this as a 3rd party problem?

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

Comment By: Thomas Heller (theller)
Date: 2002-10-18 04:20

Message:
Logged In: YES 
user_id=11105

It crashes in fdopen - looks like a bug in MS runtime library:

(in file vc98\crt\src\fdopen.c)
fdopen calls _tfopen(), creates a FILE *stream, and if the first 
character in mode is not r, w, or a, sets 'stream' to NULL to 
signal an error. Then it calls _unlock_str(stream), which 
crashes.


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

Comment By: Neal Norwitz (nnorwitz)
Date: 2002-10-17 17:30

Message:
Logged In: YES 
user_id=33168

Note:  You probably want:
  tempfile.NamedTemporaryFile(suffix=".zip")

I tried this under Linux and get: OSError: [Errno 22]
Invalid argument

So this appears to be windows specific.  Exactly which line
is causing the crash? os.fdopen?

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

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