Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

broken audio? #559

Closed
pychess opened this issue Feb 4, 2015 · 6 comments
Closed

broken audio? #559

pychess opened this issue Feb 4, 2015 · 6 comments

Comments

@pychess
Copy link
Collaborator

pychess commented Feb 4, 2015

Original issue 559 reported by thomas.spura 2010-05-31

Forwarded from https://bugzilla.redhat.com/show\_bug.cgi?id=598062:

abrt 1.1.0 detected a crash.

architecture: x86_64
cmdline: /usr/bin/python /usr/bin/pychess
component: pychess
executable: /usr/bin/pychess
kernel: 2.6.33.4-95.fc13.x86_64
package: pychess-0.10-0.4.20100504hg.fc13
reason: preferencesDialog.py:309::AttributeError: 'NoneType' object has
no attribute 'startswith'
release: Fedora release 13 (Goddard)

backtrace

preferencesDialog.py:309::AttributeError: 'NoneType' object has no
attribute 'startswith'

Traceback (most recent call last):
File "/usr/lib/python2.6/site-packages/pychess/widgets/preferencesDialog.py",
line 309, in
lambda data: data[3].startswith("audio/"))
AttributeError: 'NoneType' object has no attribute 'startswith'

Local variables in innermost frame:
data: (None, None, 'win2.ogg', None)

#################################################y

This is reproducable with the trunk verion with:

  1. open pychess on the console
  2. click on Settings->Preferences
  3. When the window appears, see the backtrace on the console.
@pychess
Copy link
Collaborator Author

pychess commented Feb 4, 2015

Original comment 1. posted by lobais 2010-06-03

This is in the context:

soundfilter = gtk.FileFilter()
soundfilter.add_custom(soundfilter.get_needed(),
lambda data: data[3].startswith("audio/"))

I can read now in http://www.pygtk.org/docs/pygtk/class-gtkfilefilter.html#method-
gtkfilefilter--add-custom that the four fields in the data tuple (which they call
filter_info for confusion) can be strings or None.
It doesn't say when they will be None, but I suppose it is on folders and nonfile
things. The patch will be to change

lambda data: data[3].startswith("audio/")

into

lambda data: data[3] and data[3].startswith("audio/")

I can't commit it right now though.

  • changed status to: Accepted

@pychess
Copy link
Collaborator Author

pychess commented Feb 4, 2015

Original comment 2. posted by thomas.spura 2010-06-06

Ok, let me know, if I can help out anyhow.

I changed it here locally and don't see any noticeable regression.

diff -r 721db5d4e091 lib/pychess/widgets/preferencesDialog.py
--- a/lib/pychess/widgets/preferencesDialog.py Tue May 11 22:33:16 2010 +0200
+++ b/lib/pychess/widgets/preferencesDialog.py Sun Jun 06 14:56:24 2010 +0200
@@ -306,7 +306,7 @@ class SoundTab:

     soundfilter = gtk.FileFilter()
     soundfilter.add\_custom(soundfilter.get\_needed(),
  •                           lambda data: data[3].startswith("audio/"))
    
  •                           lambda data: data[3] and data[3].startswith("audio/"))
     opendialog.add_filter(soundfilter)
     opendialog.set_filter(soundfilter)
    

@pychess
Copy link
Collaborator Author

pychess commented Feb 4, 2015

Original comment 3. posted by lobais 2010-06-08

Its ok, I got my hg fixed. It should be in Head now.

@pychess
Copy link
Collaborator Author

pychess commented Feb 4, 2015

Original comment 4. posted by thomas.spura 2010-06-11

Yes, this should be fixed and this, but the commit before destroyed some other parts and with now current head (1539:c37ce7c65bd9) I get a lot of warnings, posting here, to let you know (if you don't do yet).

I'd say this is fixed now.

Thanks.

##################################################################################

$ PYTHONPATH=./lib ./pychess

(pychess:4254): libglade-WARNING **: could not look up stock id '_New Game'

(pychess:4254): libglade-WARNING **: could not look up stock id '_Play Internet Chess'

(pychess:4254): libglade-WARNING **: could not look up stock id '_Load Game'

(pychess:4254): libglade-WARNING **: could not look up stock id '_Save Game'

(pychess:4254): libglade-WARNING **: could not look up stock id 'Save Game _As'

(pychess:4254): libglade-WARNING **: could not look up stock id 'Offer _Undo'

(pychess:4254): libglade-WARNING **: could not look up stock id '_Rotate Board'

(pychess:4254): libglade-WARNING **: could not look up stock id '_Fullscreen'

(pychess:4254): libglade-WARNING **: could not look up stock id 'Leave _Fullscreen'

(pychess:4254): libglade-WARNING **: could not look up stock id 'About Chess'

(pychess:4254): libglade-WARNING **: could not look up stock id 'How to play'

(pychess:4254): libglade-WARNING **: could not look up stock id 'Translate PyChess'

(pychess:4254): libglade-WARNING **: could not look up stock id 'Tip of the Day'
no stock_draw-rounded-square-unfilled icon in icon-theme-gnome
no stock_draw-rounded-square icon in icon-theme-gnome
/home/tom/programming/repositories/pychess.hg/lib/pychess/System/uistuff.py:374: GtkWarning: GtkSpinButton: setting an adjustment with non-zero page size is deprecated
self.glade = gtk.glade.XML(addDataPrefix("glade/%s" % filename))
00:11:02 Default Warning: Can't end a game that's already ended: 8 1

@pychess
Copy link
Collaborator Author

pychess commented Feb 4, 2015

Original comment 5. posted by gbtami 2010-06-24

.glade files seems fixed too, so i close this.

  • changed status to: Fixed

@pychess
Copy link
Collaborator Author

pychess commented Feb 4, 2015

Original comment 6. posted by mattgatto 2010-08-15

issue #573 has been merged into this issue.

@pychess pychess closed this as completed Feb 4, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants