[Idle-dev] Serious problems getting idlefork to display on multiple xservers

Michael Williams michael.williams@st-annes.oxford.ac.uk
Wed, 8 May 2002 21:10:57 +0100


Dear All,

Here in the Department of Physics at Oxford University we're
attempting to replace the current undergraduate programming course
(which is currently taught using Pascal) with a more modern and user
friendly one. We're running trials on a number of languages over the
next couple of months and Python seems to be the front-runner. Idlefork
appears to be the most suitable frontend for our purposes and we have
been using it without problem during the development of the course.
However, we have found a serious problem since we tried to run it in
multi-user environment.

We do not have individual workstations but rather a SunRay system which
is basically a single machine (running Solaris 5.7 in our case[0])
driving out multiple xserver displays to ~20 SunRay clients (which are
essentially dumb terminals).

  [0] This is *not* a Solaris specific problem though!

The first user to run idlefork gets on fine. However, the next user,
who is at a different terminal, which recieves the output of a different
xserver instance (i.e. has a different $DISPLAY), cannot get idlefork at
their own terminal. If they run the idle script at an xterm there is a
brief pause and then the program appears to have finished--the worst
kind of error message. However, the xserver on which idlefork was first
run now has another idlefork window! So the first person has a window
they didn't ask for, and the second has no window at all! If the first
person the does File->Exit one either window both windows disappear.

This can be verified by those of you running Linux systems by starting
up one xserver in the usual way. Then, at a Linux console (which for
example Ctrl-Alt-F2 will give you on most setups) starting up another
xserver (it makes no difference whether you are the same user or a
different one). On my Debian system (and I believe on most others) this
is done using the command "startx -- :1". You can then swap between the
two xservers using Ctrl-Alt-F7 and Ctrl-Alt-F8. Run idlefork on the
first xserver (:0), and then swap to the other (:0) and run it again. You
will get no idlefork but (:1) will have a new window.

I don't know if this is related but running idlefork with the -v
switch the second time gives the following error message:

[willmsmj@rayleigh:~]$ idle -v                                                  
Traceback (most recent call last):                                              
  File "/usr/local/bin/idle", line 4, in ?                                      
    PyShell.main()                                                              
  File "/usr/local/bin/../packages/idlefork-0.8.1/PyShell.py", line 746,        
in __init__                                                                     
    sys.stderr.write("Error: %s\n" % str(msg))                                  
TypeError: __str__ returned non-string (type instance)                          

Surely the right behaviour would be to open up a new instance of
idlefork on the xserver from which it was called? Indeed, this is the
behaviour of Idle as bundled with Python in the Tools/ directory at
present. The problem is present in both the current CVS version and
0.8.1.tar.gz available from Sourceforge.

We would really like to avoid using the basic Idle as we have to teach
computer programming in just one day (!) and believe the idlefork
interface is much more intuitive.

If anyone has any further questions about our setup (although we do not
believe this is related) feel free to ask. We're running Python2.2.1 by
the way.

Here's hoping there's a workaround or a one-liner!

-- 
Michael Williams
Department of Physics | University of Oxford
michael.williams@st-annes.oxford.ac.uk