spacetelescope / stsci.tools

STScI utility functions.
https://stscitools.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
7 stars 21 forks source link

Teal GUI crashes when using Scroll Bar #25

Open exowanderer opened 7 years ago

exowanderer commented 7 years ago

OSX Sierra 10.12 Python 3.5.2 AstroConda

In [12]: teal.teal('tweakreg')
---------------------------------------------------------------------------
UnicodeDecodeError                        Traceback (most recent call last)
/Users/jfraine/anaconda3/envs/astroconda/lib/python3.5/site-packages/stsci.tools-3.4.3-py3.5.egg/stsci/tools/teal.py in teal(theTask, parent, loadOnly, returnAs, canExecute, strict, errorsToTerm, autoClose, defaults)
    195                                       strict=strict,
--> 196                                       canExecute=canExecute)
    197 #                                     overrides=overrides)

/Users/jfraine/anaconda3/envs/astroconda/lib/python3.5/site-packages/stsci.tools-3.4.3-py3.5.egg/stsci/tools/teal.py in __init__(self, theTask, parent, title, isChild, childList, autoClose, strict, canExecute)
    483                                        title, childList,
--> 484                                        resourceDir=cfgpars.getAppDir())
    485         # We don't return from this until the GUI is closed

/Users/jfraine/anaconda3/envs/astroconda/lib/python3.5/site-packages/stsci.tools-3.4.3-py3.5.egg/stsci/tools/editpar.py in __init__(self, theTask, parent, isChild, title, childList, resourceDir)
    371             self._preMainLoop()
--> 372             self.top.mainloop()
    373             self._postMainLoop()

/Users/jfraine/anaconda3/envs/astroconda/lib/python3.5/tkinter/__init__.py in mainloop(self, n)
   1130         """Call the mainloop of Tk."""
-> 1131         self.tk.mainloop(n)
   1132     def quit(self):

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte

During handling of the above exception, another exception occurred:

AttributeError                            Traceback (most recent call last)
<ipython-input-12-154e1b9ce2cc> in <module>()
----> 1 teal.teal('tweakreg')

/Users/jfraine/anaconda3/envs/astroconda/lib/python3.5/site-packages/stsci.tools-3.4.3-py3.5.egg/stsci/tools/teal.py in teal(theTask, parent, loadOnly, returnAs, canExecute, strict, errorsToTerm, autoClose, defaults)
    207                 print(re.message.replace('\n\n','\n'))
    208             else:
--> 209                 popUpErr(parent=parent, message=re.message,
    210                          title="Bad Parameters")
    211 

AttributeError: 'UnicodeDecodeError' object has no attribute 'message'
pllim commented 7 years ago

Are you sure you are using the latest versions of stsci.tools? There was a fix for #11 which also complained about UnicodeDecodeError.

pllim commented 7 years ago

Your path says 3.4.3 but latest release is 3.4.5.

exowanderer commented 7 years ago

I can only say that I installed astroconda this morning. Then 1 hour later, during astroDrizzle training at STScI, I received that error while following the tutorial.

I would assume that I have the latest version of everything, unless it was released today.

pllim commented 7 years ago

3.4.5 was released 19 days ago and pushed to AstroConda 2 weeks ago via astroconda/astroconda-contrib#159. Try conda update stsci.tools.

exowanderer commented 7 years ago

Thank you for the responses.

I just ran "conda update stsci.tools", which claimed to have installed v3.4.5; but, when I used "stsci.tools.version", it still claims to be on version 3.4.3.

I will try to figure this out, but I wanted to let you know that this may take longer.

pllim commented 7 years ago

Did you ever pip install it in the past? It could have been picking up an old pip installation. @jhunkeler , any ideas?

pllim commented 7 years ago

Ops! I think I figured it out. The version number in setup.cfg is wrong. #3 would be remedied that but it was not merged. I apologize for the confusion.

exowanderer commented 7 years ago

Thank you for the clarification. Does this mean that I have version 3.4.5 (as Conda declared), but that the command "stsci.tools.version" is flawed?

If so, then does that bring us back to the above concern that TEAL is crashing when I scroll?

exowanderer commented 7 years ago

I just went back to test this and I have an important update.

The error did not occur when I click and drag the scroll bar; but it instead activates when I use the 3rd mouse well. I previously assumed that these actions were identical.

pllim commented 7 years ago

@exowanderer , yes, it appears your problem might still exist in the current master. I apologize for the confusion. @cdsontag will investigate and get back on this soon. In the meantime, we ask for your patience. Thanks for reporting this!