[IPython-user] [pyreadline]Support for running as subprocess?
jorgen.stenarson at bostream.nu
Thu Mar 16 15:45:08 CST 2006
Liu Jin skrev:
> [Sorry if this is a repost, I'm not sure my mailer delivered it or not]
> On Windows, IPython running as an inferior process in Emacs produces
> no output. That's because Windows has no psuedo-tty, so the
> WriteConsole etc. calls are failing. I made a quick&dirty change to
> console.py along these lines:
> import os
> ntemacs_hack = int(os.environ.get('READLINE_NTEMACS_HACK','0'))
> class Console(object):
> if ntemacs_hack:
> def write_color(self, text, attr=None):
> junk = c_int(0)
> self.WriteFile(self.hout, text, len(text), byref(junk), None)
> return len(text)
> write_plain = write_color
> original write_color & write_plain definitions
> The main functionalities seem ok. But there are plenty more console
> api calls uncovered, yet I'm uncertain how to fix them. I guess this
> problem will eventually disappear as IPython be decoupled from
> readline, but any chance for a quick fix before that?
When I try your patch ipython crashes in emacs producing the attached
crash_report. Actually I have a variation of your patch looking at the
EMACS environment variable that emacs sets to true when running an
inferior process (at least my version of xemacs).
What versions of emacs/xemacs, python-mode.el and ipython.el, do you
use? Which revisions of ipython.py and pyreadline?
I have also tried to use an inferior python process (disabling
ipython.el) and that works without your patch. Perhaps Fernando has some
ideas? I'm no emacs user myself and I don't understand the mechanics of
the emacs connection.
The crash seems to be when I hit some code in genutils.write that is not
supposed to run (according to code comments).
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: IPython_crash_report-liu patch.txt
More information about the IPython-user