[Patches] [ python-Patches-1003535 ] Simple File fix for Windows Runtime incompatability

SourceForge.net noreply at sourceforge.net
Thu Aug 26 23:57:56 CEST 2004


Patches item #1003535, was opened at 2004-08-04 22:17
Message generated for change (Comment added) made by loewis
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1003535&group_id=5470

Category: Core (C code)
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Jeremy Schwartz (mdjeremy)
Assigned to: Nobody/Anonymous (nobody)
Summary: Simple File fix for Windows Runtime incompatability

Initial Comment:

Problem:

PyRun_SimpleFile - Using this function on Windows with
MSVC7 (VS .NET) causes a crash.

Reason: 

1)Pre built binaries link to msvcrt.dll. New version of
MSVC link to msvcrt71.dll. The FILE structure is
different across the two versions of runtime library. 

2) If python23.dll is rebuilt using the latest binary,
and issue exist where passing in FILE * still causes
the runtime library to throw an exception due to
running in the dll's context.

Solution:

Remove both of these problems by adding a new function
that only takes the filename (future maybe fopen flags)
and have the dll open the file itself and pass it on.

New function added to pythonrun.c and pythonrun.h

int
PyRun_SimpleFileWithOpen(const char *filename)

Takes just the file name, opens the file and then pass
it on.


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

>Comment By: Martin v. Löwis (loewis)
Date: 2004-08-26 23:57

Message:
Logged In: YES 
user_id=21627

I would like to see the following changes to the patch:
- remove all parts that are not strictly relevant (IOW, make
it minimal)
- call the function PyRun_SimpleFileName
- Add a PyCompilerFlags*. If you want to, you can allow this
argument to be NULL.
- Add a PyRun_SimpleParseFileName parallel function, and
PyRun_FileName
  (i.e. all File APIs except for Any, which supports
terminals and is irrelevant here)
- Provide documentation patches as well.

Are you willing to carry out these changes?

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

Comment By: Tim Peters (tim_one)
Date: 2004-08-09 02:40

Message:
Logged In: YES 
user_id=31435

There appear to be all sorts of things in the patch that don't 
have anything to do with the new function.  Is that 
intentional?

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

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


More information about the Patches mailing list