Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > IDLE doesn't show stderr output from extension modules

Reply
Thread Tools

IDLE doesn't show stderr output from extension modules

 
 
Brian Cole
Guest
Posts: n/a
 
      12-19-2008
I'm importing an extension module created with SWIG. When working with
the module interactively in IDLE there should be warning and error
messages printed to stderr by the extension module. However, these are
not being caught by the IDLE window, they are going directly to the
terminal that was used to start IDLE.

Strange, because sys.stderr.write() does print to the IDLE window.
I've tried this on Windows and OSX, so it doesn't appear to be a
platform issue. Is this just a fundamental deficiency in the IDLE
shell prompt?

-Brian
 
Reply With Quote
 
 
 
 
Robert Kern
Guest
Posts: n/a
 
      12-19-2008
Brian Cole wrote:
> I'm importing an extension module created with SWIG. When working with
> the module interactively in IDLE there should be warning and error
> messages printed to stderr by the extension module. However, these are
> not being caught by the IDLE window, they are going directly to the
> terminal that was used to start IDLE.
>
> Strange, because sys.stderr.write() does print to the IDLE window.
> I've tried this on Windows and OSX, so it doesn't appear to be a
> platform issue. Is this just a fundamental deficiency in the IDLE
> shell prompt?


Yup. IDLE swaps out the sys.stdout and sys.stderr objects at the Python level.
It does not replace the STDOUT and STDERR C file pointers. Python code and C
extension modules which use the Python APIs to write stuff out should get
redirected, but extension modules that use fprintf(), etc., directly to STDOUT
and STDERR won't.

--
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
that is made terrible by our own mad attempt to interpret it as though it had
an underlying truth."
-- Umberto Eco

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Stderr catch with Javascript to show progress of a running program ? goldtech Javascript 5 08-09-2010 11:38 AM
avoid stderr output Gi?rgenes Python 0 05-25-2004 09:28 PM
Unload extension modules when python22.dll unloads... [using C extension interpreter] Anand Python 3 11-08-2003 05:50 AM
Re: Capture output from stderr Grant Edwards Python 2 08-06-2003 03:47 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57