Unable to get formatted traceback info

Mark markmcmahon at my-deja.com
Mon Aug 28 08:22:52 EDT 2000


In article <8o6314$q2n$1 at nnrp1.deja.com>,
  Mark <markmcmahon at my-deja.com> wrote:
> I am writing a shell extension for windows (so NO stdout, stderr etc)
>
> I redirected output (within the dll) using freopen so that these
streams
> would go to a file.
>
> Then I would like to open a script file, if there are errors I would
> like to get the traceback information (if possible without having to
> format it myself).
>
> So I import the file, and use PYErr_Print() if an error occurs. I
would
> have hoped that this error information would have been written to the
> file that I have redirected the stderr stream to - but nothing gets
> written.
>
> Does anyone have any ideas
>

I have done some extra testing of this
a) I tried with a new Dialog based application and I got it to work
b) I included my python access functions into the DLL and it did not
work.
c) I inserted an fprintf(stderr, "..."); before my PyErr_Print()
statement and found that the fprintf message was correctly going to the
redirected file but not the PyErr_Print() message.

Is there something I need to do before/during initialization?
Or is this solely due to the fact that it is within a DLL and not an
application that should have access to the console.

Thanks for any help
    Mark

PS. Would it not be more generic to have the PyErr_Print return a string
or print to a specified location (FILE*) (or have a different function
that does!)


Sent via Deja.com http://www.deja.com/
Before you buy.



More information about the Python-list mailing list