tkinter exception when using pyraf

Bug #111917 reported by humufr
4
Affects Status Importance Assigned to Milestone
python-stdlib-extensions (Ubuntu)
Fix Released
Undecided
Chris S

Bug Description

Binary package hint: python-tk

Hi,

I have a problem when I'm using pyraf with feisty and all python (I didn't have this problem with edgy).
I just upgrade my computer to feisty with update-manager. I have iraf installed on my computer (an astronomical software) and it's working fine (still) but a very nice interface has been provided byt STSCI pyraf to use iraf with python. This software was wroking fine until the upgrade. Since each time I'm trying to use the different plot function in pyraf it's not working and I have a Tkinter exception:

Exception in Tkinter callback
Traceback (most recent call last):
  File "lib-tk/Tkinter.py", line 1406, in __call__
    return self.func(*args)
  File "/usr/lib/python2.5/site-packages/pyraf/epar.py", line 795, in execute
    self.runTask()
  File "/usr/lib/python2.5/site-packages/pyraf/epar.py", line 1047, in runTask
    self.taskObject.run(mode='h', _save=1)
  File "/usr/lib/python2.5/site-packages/pyraf/iraftask.py", line 277, in run
    self._run(redirKW, specialKW)
  File "/usr/lib/python2.5/site-packages/pyraf/iraftask.py", line 716, in _run
    (self, iraf.getVarDict()), redirKW)
  File "/usr/lib/python2.5/site-packages/pyraf/irafexecute.py", line 325, in IrafExecute
    irafprocess.run(task, pstdin=stdin, pstdout=stdout, pstderr=stderr)
  File "/usr/lib/python2.5/site-packages/pyraf/irafexecute.py", line 488, in run
    self.slave()
  File "/usr/lib/python2.5/site-packages/pyraf/irafexecute.py", line 623, in slave
    xmit()
  File "/usr/lib/python2.5/site-packages/pyraf/irafexecute.py", line 796, in xmit
    wcs = gki.kernel.control(sdata[2:])
  File "/usr/lib/python2.5/site-packages/pyraf/gki.py", line 926, in control
    return self.stdgraph.control(gkiMetacode)
  File "/usr/lib/python2.5/site-packages/pyraf/gki.py", line 864, in control
    if not self.stdgraph: self.openKernel()
  File "/usr/lib/python2.5/site-packages/pyraf/gwm.py", line 123, in openKernel
    self.window()
  File "/usr/lib/python2.5/site-packages/pyraf/gwm.py", line 62, in window
    self.windows[windowName] = self.GkiKernelClass(windowName, self)
  File "/usr/lib/python2.5/site-packages/pyraf/gkitkbase.py", line 191, in __init__
    self.makeStatus()
  File "/usr/lib/python2.5/site-packages/pyraf/gkitkbase.py", line 221, in makeStatus
    self.top.status = msgiobuffer.MsgIOBuffer(self.top, width=600)
  File "/usr/lib/python2.5/site-packages/pyraf/msgiobuffer.py", line 133, in __init__
    self.msgIO.canvas.yview_moveto(1.0)
  File "lib-tk/Tkinter.py", line 2321, in yview_moveto
    self.tk.call(self._w, 'yview', 'moveto', fraction)
TclError: expected floating-point number but got "1.0"
--> Exception in Tkinter callback

PANIC in `/usr/local/iraf/iraf/noao/bin.linux/x_onedspec.e': Write to IPC with no reader
Traceback (most recent call last):
  File "lib-tk/Tkinter.py", line 1406, in __call__
    return self.func(*args)
  File "lib-tk/Tkinter.py", line 501, in callit
    func(*args)
  File "/usr/lib/python2.5/site-packages/pyraf/Ptkplot.py", line 117, in idleRedraw
    self.immediateRedraw()
  File "/usr/lib/python2.5/site-packages/pyraf/Ptkplot.py", line 105, in immediateRedraw
    self.redraw(self)
AttributeError: PyrafCanvas instance has no attribute 'redraw'

I contact SCTSCI to find a solution to the problem and the person in charge ask me to do some test but run out of idea to solve this problem. It's seems that it's feisty dependant so it's why I'm putting this bug here. I think it's a very important bug because I know a lot of astronome using ubuntu and pyraf.

Here you'll find a copy of the mail exchange:

---------------------------------------

Hi,

   I have a problem with ubuntu feisty and pyraf. I'm not sure which is
   responsible of this problem.

   It's not impossible to plot anything with pyraf since the installation of
   feisty. The error message is:

   Traceback (most recent call last):
     File "lib-tk/Tkinter.py", line 1406, in __call__
       return self.func(*args)
     File "lib-tk/Tkinter.py", line 501, in callit
       func(*args)
     File "/usr/lib/python2.5/site-packages/pyraf/Ptkplot.py", line 117, in
   idleRedraw
       self.immediateRedraw()
     File "/usr/lib/python2.5/site-packages/pyraf/Ptkplot.py", line 105, in
   immediateRedraw
       self.redraw(self)
   AttributeError: PyrafCanvas instance has no attribute 'redraw'

   I tried with the version 2.4 and I have exactly the same problem.

   I used the trac version and the official version 2.4 with the same result.

   You can ask me to do any test,

   Thanks

   Nicolas

-----------------------------

   Hi Nicolas,

   Could you try running a test please?

   python
   >>>import Tkinter
   >>>Tkinter._test()

   Does it work?
   And which plotting command is giving the error?
   Does this work?

   pyraf
   -->prow dev$pix 12

-------------------------------------------

the first test is working fine, no error message, no warning and it's opening
the window.

The second test is not working and the error message is:

--> prow dev$pix 12
Traceback (innermost last):
  File "<CL script CL1>", line 1, in <module>
    iraf.prow('dev$pix', '12', _save=1)
  File "lib-tk/Tkinter.py", line 2321, in yview_moveto
    self.tk.call(self._w, 'yview', 'moveto', fraction)
TclError: expected floating-point number but got "1.0"
--> Exception in Tkinter callback

PANIC in `/usr/local/iraf/iraf/bin.linux/x_plot.e': Write to IPC with no
reader
Traceback (most recent call last):
  File "lib-tk/Tkinter.py", line 1406, in __call__
    return self.func(*args)
  File "lib-tk/Tkinter.py", line 501, in callit
    func(*args)
  File "/usr/lib/python2.5/site-packages/pyraf/Ptkplot.py", line 117, in
idleRedraw
    self.immediateRedraw()
  File "/usr/lib/python2.5/site-packages/pyraf/Ptkplot.py", line 105, in
immediateRedraw
    self.redraw(self)
AttributeError: PyrafCanvas instance has no attribute 'redraw'
error: graphics window `graphics1' doesn't exist

Thanks to look at my problem

--------------------------------------------

oups I forgot to tell you the command to plot:

I was just trying to do a simple:

--> splot dev$pix 1

Nicolas

ps: iraf is working fine

-------------------------------------------
   Hi Hicolas,

   I see a Tcl error message. What versions of python and Tcl/Tk are you running? If you are not sure, run the following:

   python
   >>> import Tkinter
   >>> tk=Tkinter.Tk()
   >>> tk.getvar('tk_library')
   >>> tk.getvar('tcl_library')

--------------------------------------

From the package it seems that the tcl/tk are the 8.4.15-ubuntu1 version. It's
confirm by the commands you send.

The result are here. Do I have to fill a bug report for ubuntu? If yes what I
have to tell them exactly?

python
Python 2.5.1c1 (release25-maint, Apr 12 2007, 21:00:25)
[GCC 4.1.2 (Ubuntu 4.1.2-0ubuntu4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import Tkinter
>>> tk = Tkinter.Tk()
>>> tk.getvar('tk_library')
u'/usr/lib/tk8.4'
>>> tk.getvar('tcl_library')
'/usr/lib/tcl8.4'

Thanks,

--------------------------------------
 Hi Nicolas,

   The test below works for me with tcl/tk 8.4 and python 2.5.1 final on Solaris. Let me know if it gives an error message.

   python
   --> import Tkinter
   --> canvas=Tkinter.Canvas()
   --> canvas.yview_moveto(1.0)
   --> canvas.yview_moveto("1.0")

-----------------------------------------------------------

It's working here too. The window who has been open is still blank but I don't
have any error message:

Python 2.5.1c1 (release25-maint, Apr 12 2007, 21:00:25)
[GCC 4.1.2 (Ubuntu 4.1.2-0ubuntu4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import Tkinter
>>> canvas=Tkinter.Canvas()
>>> canvas.yview_moveto(1.0)
>>> canvas.yview_moveto("1.0")
>>>

---------------------------------------------------------
 Unfortunately I am running out of ideas. Is there an easy way to upgrade to python 2.5.1 final? I don't see anythin gin the release notes between 2.5.1.c1 and 2.5.1 that could cause or fix this but who knows...

-------------------------------------------

Thanks in advance to help to correct this bug.

Nicolas

Revision history for this message
humufr (humufr-deactivatedaccount) wrote :

With the STSCI we found a workaround this bug and it seems to be related to the well known bug https://launchpad.net/ubuntu/+source/scribus/+bug/37711

at least the solution is the same:

LC_ALL pyraf

and everything is working fine. So it's seems that the bug with the locale are not only related to qt/scim but to other library. I thinking that this bug is becoming to be very annoying and can be disastrous to the distribution (ubuntu is the only one touch by this bug!) or perhaps only the english speaker can use ubuntu?

At least it's working for me and perhaps that will help some people.

Thanks for ubuntu, my comments are only there because I like a lot this distribution but it's very difficult for me to advise this distribution to this kind of problem.

Revision history for this message
humufr (humufr-deactivatedaccount) wrote :

oh I forgot to tell, I tried to remove scim and the other package associated but that didn't change anything to the problem!

Revision history for this message
Andreas Moog (ampelbein) wrote : Old standing report

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Thank you for taking the time to report this bug and helping to make
Ubuntu better. You reported this bug a while ago and there hasn't been
any activity in it recently. We were wondering is this still an issue
for you? Can you try with latest Ubuntu release? Thanks in advance.

 status incomplete
 assignee <email address hidden>
 subscribe

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkit4xQACgkQ06FgkPZwicQO1QCfRroSdEHQC3ePlcxjUfFs7KkD
LikAnjdGKjyfsFAsmZem2GMLMjR4JKGp
=1KxK
-----END PGP SIGNATURE-----

Changed in python-stdlib-extensions:
assignee: nobody → andreas-moog
status: New → Incomplete
Revision history for this message
Andreas Moog (ampelbein) wrote :

We are closing this bug report because it lacks the information we need to investigate the problem, as described in the previous comments. Please reopen it if you can give us the missing information, and don't hesitate to submit bug reports in the future. To reopen the bug report you can click on the current status, under the Status column, and change the Status back to "New". Thanks again!

Changed in python-stdlib-extensions:
assignee: andreas-moog → nobody
status: Incomplete → Invalid
Revision history for this message
Chris S (chris.s) wrote :

Hi all,

It turns out this is related to internationalization in a Tkinter call. A small change has been made to PyRAF so that this crash no longer occurs. I am not sure who at STSCI originally fielded the Nicolas' call. However, PyRAF users (on any OS) should be aware that running tasks such as "implot", "splot", etc, which rely on terminal character input, will be affected by LC_LANG and specifically (in this case) LC_NUMERIC.

This is not a bug in Python or Ubuntu.

Hope that helps,
Chris

Changed in python-stdlib-extensions:
assignee: nobody → cdsontag
status: Invalid → Fix Committed
Przemek K. (azrael)
Changed in python-stdlib-extensions (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.