FS#21566 - [pychess] Pychess engine gone

Attached to Project: Community Packages
Opened by Jouke Witteveen (jouke) - Tuesday, 02 November 2010, 10:21 GMT
Last edited by Allan McRae (Allan) - Monday, 15 November 2010, 05:31 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Allan McRae (Allan)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

The chess engine included in Pychess is not available as computer opponent.
Iirc it disappeared somewhere near the Python upgrade to version 3, but a similar bug is listed here:
https://bugs.launchpad.net/ubuntu/+source/pychess/+bug/572320
This task depends upon

Closed by  Allan McRae (Allan)
Monday, 15 November 2010, 05:31 GMT
Reason for closing:  Fixed
Additional comments about closing:  pychess-0.10rc1-2
Comment by Allan McRae (Allan) - Tuesday, 02 November 2010, 10:31 GMT
What version are you using? I'm using it now in 0.10rc1-1...
Comment by Jouke Witteveen (jouke) - Tuesday, 02 November 2010, 11:07 GMT
Both beta4 and rc1 have the problem on both my i686 and my x86_64 machines.
I have attached the output of `pacman -Qet` of my i686, so it is possible to check for a hidden dependency.

Running pychess from the console did not yield any useful errors.
Comment by Allan McRae (Allan) - Tuesday, 02 November 2010, 11:17 GMT
Try removing ~/.local/share/pychess
Comment by Jouke Witteveen (jouke) - Tuesday, 02 November 2010, 11:30 GMT
No good
Comment by Allan McRae (Allan) - Tuesday, 02 November 2010, 11:36 GMT
Please post the console output. Also is the pychess engine completely missing in the selection dialog or can you select it and then it freezes?
Comment by Jouke Witteveen (jouke) - Tuesday, 02 November 2010, 11:54 GMT
With no pychess folders in ~/ it goes like this:
---
$ pychess
** Message: pygobject_register_sinkfunc is deprecated (GstObject)
/usr/lib/python2.7/site-packages/pychess/System/uistuff.py:438: GtkWarning: GtkSpinButton: setting an adjustment with non-zero page size is deprecated
self.glade = gtk.glade.XML(addDataPrefix("glade/%s" % filename))
12:45:04 Default Warning: Tried to set combobox to 1, but it has only got 1 items
---
The pychess engine is completely missing.

Again, but now with python (version 3) installed:
---
$ pychess
** Message: pygobject_register_sinkfunc is deprecated (GstObject)
/usr/lib/python2.7/site-packages/pychess/System/uistuff.py:438: GtkWarning: GtkSpinButton: setting an adjustment with non-zero page size is deprecated
self.glade = gtk.glade.XML(addDataPrefix("glade/%s" % filename))
/usr/lib/python2.7/site-packages/pychess/Players/engineNest.py:341: FutureWarning: The behavior of this method will change in future versions. Use specific 'len(elem)' or 'elem is not None' test instead.
if not engine2:
12:46:59 ('Python', '12:11:59.494') Error: No child processes

12:46:59 ('Python', '12:11:59.494') Error: File "/usr/lib/python2.7/site-packages/pychess/Players/PyChess.py", line 3

/usr/lib/python2.7/site-packages/pychess/System/SubProcess.py:126: Warning: g_io_channel_read_line: assertion `channel->is_readable' failed
line = channel.next()#readline()
12:46:59 Default Warning: Engine PyChess.py failed discovery:
---
The pychess engine is present but does not work (a game cannot be started against it).

This time a ~/.config/pychess/engines.xml gets created, though. Changing all references to python into references to python2 in that file makes the pychess engine playable.
Removing python (version 3) makes the pychess engine invisible to the program again.
Comment by Jouke Witteveen (jouke) - Thursday, 11 November 2010, 09:43 GMT
The following patch, relative to /usr/lib/python2.7/site-packages/pychess, fixes the problem. I suppose it also fixes another python2/3 issue with the shatranj.py engine.


--- Players/engineNest.py.orig 2010-11-11 10:38:22.968899605 +0100
+++ Players/engineNest.py 2010-11-11 10:31:44.946738649 +0100
@@ -66,9 +66,9 @@
<engines version="%s">
<engine protocol="cecp" protover="2" binname="PyChess.py">
<meta><country>dk</country></meta>
- <vm binname="python"><args><arg name='0' value="-u"/></args></vm></engine>
+ <vm binname="python2"><args><arg name='0' value="-u"/></args></vm></engine>
<engine protocol="cecp" protover="2" binname="shatranj.py">
- <vm binname="python"><args><arg name='0' value="-u"/></args></vm>
+ <vm binname="python2"><args><arg name='0' value="-u"/></args></vm>
<args><arg name='0' value='-xboard'/></args></engine>
<engine protocol="cecp" protover="2" binname="gnuchess">
<meta><country>us</country></meta>

Loading...