[Python-bugs-list] Python 1.5.2 bug, tried to post but got error (PR#121)

bkc@murkworks.com bkc@murkworks.com
Wed, 3 Nov 1999 19:27:17 -0500 (EST)


I tried to post a bug, but got this error:

The system encountered a fatal error 
After command: 
Received: 
The last error code was: Connection refused 

Web interface using {HYPERLINK "http://samba.anu.edu.au/jitterbug/"}Jitterbug 
{HYPERLINK "../python-bugs/"}Public interface 
{HYPERLINK "../python-bugs.private"}Private interface (requires password) 
{HYPERLINK "http://www.python.org/"}Python home page 

-----
Here's what I said for Python 1.5.2 on Win32 #0

PyRun_SimpleFile, PyRun_File and other functions that take a FILE * are not 
usable on WIN32 from non-VC applications because python15.dll is statically 
linked to the MS runtime DLL. Embedding applications that try to use these 
functions are passing in FILE * structures that do not match MS's runtime 
format. 

For example, I'm using Python in a Borland C++ Builder application. Although I 
can open a FILE *, when passed to python15.dll the FILE * is not usable.

The addition of two helper functions would solve this problem:

FILE * PyRun_OpenFile(char *file, char *mode) 
{
  return fopen(file,mode)
}

int PyRun_CloseFile(FILE *ptr)
{
  return fclose(ptr)
}

This way embedding apps could get python15.dll to open the file and it would 
work.

A temporary workaround is to always load the .pyc file in PyRun_SimpleFile..


Brad Clements,                bkc@murkworks.com   (315)268-1000
http://www.murkworks.com                          (315)268-9812 Fax
netmeeting: ils://ils.murkworks.com               ICQ: 14856937