Bug 330675 - The game cannot start either on local or server
Summary: The game cannot start either on local or server
Status: RESOLVED FIXED
Alias: None
Product: kajongg
Classification: Applications
Component: general (show other bugs)
Version: 4.11.0
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Wolfgang Rohdewald
URL:
Keywords:
: 345409 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-02-02 18:08 UTC by pedron.alexandre
Modified: 2015-03-30 05:33 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.12.3


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description pedron.alexandre 2014-02-02 18:08:31 UTC
Every time I want to start a new game, a window appears entitled "Sorry - Kajongg", saying : "shuffle() takes at most 3 arguments (4 given)"


Reproducible: Always

Actual Results:  
The game doesn't start, and nothing happens after.

Expected Results:  
The game should have started

Here are the console info after I type "kajongg" and try to start a game:

Peer will receive following PB traceback:
Unhandled Error
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/twisted/spread/banana.py", line 153, in gotItem
    self.callExpressionReceived(item)
  File "/usr/lib/python2.7/dist-packages/twisted/spread/banana.py", line 116, in callExpressionReceived
    self.expressionReceived(obj)
  File "/usr/lib/python2.7/dist-packages/twisted/spread/pb.py", line 565, in expressionReceived
    method(*sexp[1:])
  File "/usr/lib/python2.7/dist-packages/twisted/spread/pb.py", line 877, in proto_message
    self._recvMessage(self.localObjectForID, requestID, objectID, message, answerRequired, netArgs, netKw)
--- <exception caught here> ---
  File "/usr/lib/python2.7/dist-packages/twisted/spread/pb.py", line 891, in _recvMessage
    netResult = object.remoteMessageReceived(self, message, netArgs, netKw)
  File "/usr/lib/python2.7/dist-packages/twisted/spread/pb.py", line 242, in perspectiveMessageReceived
    state = method(*args, **kw)
  File "/usr/share/kde4/apps/kajongg/server.py", line 1120, in perspective_startGame
    return self.server.startGame(self, tableid)
  File "/usr/share/kde4/apps/kajongg/server.py", line 948, in startGame
    return self._lookupTable(tableid).readyForGameStart(user)
  File "/usr/share/kde4/apps/kajongg/server.py", line 311, in readyForGameStart
    self.game = self.__prepareNewGame()
  File "/usr/share/kde4/apps/kajongg/server.py", line 260, in __prepareNewGame
    playOpen=self.playOpen, autoPlay=self.autoPlay, wantedGame=self.wantedGame, shouldSave=True)
  File "/usr/share/kde4/apps/kajongg/game.py", line 663, in __init__
    wantedGame=wantedGame, shouldSave=shouldSave, client=client)
  File "/usr/share/kde4/apps/kajongg/game.py", line 168, in __init__
    self.__shufflePlayers()
  File "/usr/share/kde4/apps/kajongg/game.py", line 348, in __shufflePlayers
    self.randomGenerator.shuffle(self.players)
  File "/usr/share/kde4/apps/kajongg/game.py", line 61, in shuffle
    Random.shuffle(self, listValue, func, intType)
exceptions.TypeError: shuffle() takes at most 3 arguments (4 given)
C: shuffle() takes at most 3 arguments (4 given)
Comment 1 Wolfgang Rohdewald 2014-02-02 23:09:03 UTC
Git commit 1ce8799b65064d94b883ba1b1369a74f98c40d76 by Wolfgang Rohdewald.
Committed on 02/02/2014 at 19:49.
Pushed by wrohdewald into branch 'KDE/4.12'.

make Random shuffle work with both Python 2.7.5 and 2.7.6

2.7.6 changed the API for shuffle(), released in November 2013.

This fix may change the minimal python version needed (currently 2.6.0).
But since I do not have anything older than 2.7.5 installed, it is
difficult to tell. I checked the history of python lib random.py
and there _should_ be no problem.

People installing KDE/4.12 should already have some recent python,
so it should not matter. Anyway this is why I will not backport
this fix to KDE/4.11. And since 4.12.2 is about being released, I put
this fix into 4.12.3
FIXED-IN: 4.12.3

M  +3    -2    src/game.py

http://commits.kde.org/kajongg/1ce8799b65064d94b883ba1b1369a74f98c40d76
Comment 2 Wolfgang Rohdewald 2015-03-30 05:33:19 UTC
*** Bug 345409 has been marked as a duplicate of this bug. ***