Bug 498694

Summary: Tkinter - Traceback when using menus in PySolFC
Product: [Fedora] Fedora Reporter: Ronald L Humble <deadletterfile>
Component: pythonAssignee: Dave Malcolm <dmalcolm>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: 11CC: cummings, david.m.highley, dmalcolm, ivazqueznet, james.antill, jonathansteffan
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-06-28 12:19:48 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Crashes here too none

Description Ronald L Humble 2009-05-02 03:32:35 UTC
Description of problem: Problem seems to be discussed here:
http://www.gossamer-threads.com/lists/python/python/694249
Any use of a menu in PySolFC causes crash

Install from Preview KDE LiveCD

Version-Release number of selected component (if applicable):
tkinter-2.6-7.fc11.i586

How reproducible:
Any use of a menu in PySolFC causes crash


Steps to Reproduce:
1.Any use of a menu in PySolFC causes crash
2.
3.
  
Actual results:


Expected results:


Additional info:
Same error with Sourceforge PySolFC code.
$ pysol
/usr/lib/python2.6/site-packages/pysollib/init.py:156: DeprecationWarning: os.popen3 is deprecated.  Use the subprocess module.
  pin, pout, perr = os.popen3(settings.FCS_COMMAND+' --help')                                                                  
Traceback (most recent call last):                                                                                             
  File "/usr/lib/python2.6/site-packages/pysollib/pysolaudio.py", line 349, in playLoop                                        
    audiodev = ossaudiodev.open('w')                                                                                           
IOError: [Errno 2] No such file or directory: '/dev/dsp'                                                                       
Traceback (most recent call last):                                                                                             
  File "/usr/lib/python2.6/site-packages/pysollib/app.py", line 529, in mainloop                                               
    self.runGame(id, random)                                                                                                   
  File "/usr/lib/python2.6/site-packages/pysollib/app.py", line 626, in runGame
    self.menubar.updateFavoriteGamesMenu()
  File "/usr/lib/python2.6/site-packages/pysollib/tile/menubar.py", line 884, in updateFavoriteGamesMenu
    self.updateGamesMenu(submenu, games)
  File "/usr/lib/python2.6/site-packages/pysollib/tile/menubar.py", line 809, in updateGamesMenu
    menu.delete(0, 'last')
  File "/usr/lib/python2.6/lib-tk/Tkinter.py", line 2670, in delete
    if c in self._tclCommands:
TypeError: argument of type 'NoneType' is not iterable
Traceback (most recent call last):
  File "/usr/share/PySolFC/pysol.py", line 32, in <module>
    sys.exit(main(sys.argv))
  File "/usr/lib/python2.6/site-packages/pysollib/main.py", line 374, in main
    app.mainloop()
  File "/usr/lib/python2.6/site-packages/pysollib/app.py", line 529, in mainloop
    self.runGame(id, random)
  File "/usr/lib/python2.6/site-packages/pysollib/app.py", line 626, in runGame
    self.menubar.updateFavoriteGamesMenu()
  File "/usr/lib/python2.6/site-packages/pysollib/tile/menubar.py", line 884, in updateFavoriteGamesMenu
    self.updateGamesMenu(submenu, games)
  File "/usr/lib/python2.6/site-packages/pysollib/tile/menubar.py", line 809, in updateGamesMenu
    menu.delete(0, 'last')
  File "/usr/lib/python2.6/lib-tk/Tkinter.py", line 2670, in delete
    if c in self._tclCommands:
TypeError: argument of type 'NoneType' is not iterable

Comment 1 Bug Zapper 2009-06-09 14:59:06 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 11 development cycle.
Changing version to '11'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 2 Steven A. Falco 2009-06-17 01:59:45 UTC
Created attachment 348201 [details]
Crashes here too

Comment 3 Steven A. Falco 2009-06-17 02:01:34 UTC
My above comment (#2) is for a fresh install of F11 on an Asus eee 900.  Pysol was working fine on this machine under F10.

Comment 4 Stewart Adam 2009-07-21 19:03:02 UTC
*** Bug 509684 has been marked as a duplicate of this bug. ***

Comment 5 Ronald L Humble 2009-08-26 16:38:07 UTC
SOLUTION:
/usr/bin/pysol running under KDE
I backed up then replaced /usr/lib/python2.6/lib-tk/Tkinter.py with file downloaded from python.org
tar -jvxf Python-2.6.2.tar.bz2 Python-2.6.2/Lib/lib-tk/Tkinter.py
-rw-rw-r-- 1 user user 158576 2009-03-06 20:51 Python-2.6.2/Lib/lib-tk/Tkinter.py

Menu now works. Fedora Tkinter.py version is 65971: new file is 70220

WARNING: I am not much of a programmer. This may break something. YMMV.

DETAILS:
Problem appears to be in the delete function of Tkinter.py
Reference:  bugs.python.org/issue3774

Below is a diff (for the delete function only) in the referenced Tkinter.py files:

2664,2671c2666,2675
<         cmds = []
<         (num_index1, num_index2) = (self.index(index1), self.index(index2))
<         if (num_index1 is not None) and (num_index2 is not None):
<             for i in range(num_index1, num_index2 + 1):
<                 if 'command' in self.entryconfig(i):
<                     c = str(self.entrycget(i, 'command'))
<                     if c in self._tclCommands:
<                         cmds.append(c)
---
>
>         num_index1, num_index2 = self.index(index1), self.index(index2)
>         if (num_index1 is None) or (num_index2 is None):
>             num_index1, num_index2 = 0, -1
>
>         for i in range(num_index1, num_index2 + 1):
>             if 'command' in self.entryconfig(i):
>                 c = str(self.entrycget(i, 'command'))
>                 if c:
>                     self.deletecommand(c)
2673,2674d2676
<         for c in cmds:
<             self.deletecommand(c)

EXTRA NONRELATED:
pysol/python complaint of popen3 depreciated. Below is patch to 
/usr/lib/python2.6/site-packages/pysollib/init.py

156c156
<             pin, pout, perr = os.popen3(settings.FCS_COMMAND+' --help')
---
>             pin, pout, perr = subprocess.Popen(settings.FCS_COMMAND+' --help')

No problems so far.

Finally and of little value...
I edited /usr/lib/python2.6/site-packages/pysollib/tk/menubar.py to change "Cusom" to "Custom"
(line 765)
and /usr/lib/python2.6/site-packages/pysollib/tile/menubar.py (line 761) and ran

cd /usr/lib/python2.6/site-packages/pysollib/tile/
python -O /usr/lib/python2.6/py_compile.py menubar.py
cd /usr/lib/python2.6/site-packages/pysollib/tk/
python -O /usr/lib/python2.6/py_compile.py menubar.py


I am a happy guy. Thanks for your time.

--RoyBoy626

Comment 6 David Highley 2009-09-26 03:21:38 UTC
Worked for me as well. For 64 bit change lines:
python -O /usr/lib/python2.6/py_compile.py menubar.py
to
python -O /usr/lib64/python2.6/py_compile.py menubar.py

Comment 7 Dave Malcolm 2009-12-02 22:46:34 UTC
As noted in comment #5, this is upstream bug: http://bugs.python.org/issue3774

It affects the Python-2.6 tarball (and thus in Fedora 11), but is fixed in the Python-2.6.2 tarball (and thus in Fedora 12).

Backporting the patch to F-11 looks sane, if there's a demand (though any Python update needs a fair amount of testing given that critical system components depend on Python)

Comment 8 Bug Zapper 2010-04-27 14:04:01 UTC
This message is a reminder that Fedora 11 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 11.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '11'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 11's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 11 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 9 Bug Zapper 2010-06-28 12:19:48 UTC
Fedora 11 changed to end-of-life (EOL) status on 2010-06-25. Fedora 11 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.