colonelnugget / pychess

Automatically exported from code.google.com/p/pychess
GNU General Public License v3.0
0 stars 0 forks source link

Error when trying to paste pgn into 'Enter Game Notation' #913

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I open a pgn file in an editor and copy and paste it into Enter Game Notation.
I get this error:

Traceback (most recent call last):
  File "/usr/lib64/python2.7/threading.py", line 811, in __bootstrap_inner
    self.run()
  File "/home/john/dev/pychess/main2/pychess/lib/pychess/System/GtkWorker.py", line 179, in run
    self.result = self.func(self)
  File "/home/john/dev/pychess/main2/pychess/lib/pychess/widgets/ionest.py", line 34, in work
    return workfunc(w, gamemodel, player0tup, player1tup, loaddata)
  File "/home/john/dev/pychess/main2/pychess/lib/pychess/widgets/ionest.py", line 98, in workfunc
    gamemodel.setPlayers(players)
  File "/home/john/dev/pychess/main2/pychess/lib/pychess/Utils/GameModel.py", line 196, in setPlayers
    assert self.status == WAITING_TO_START
AssertionError

Traceback (most recent call last):
  File "/home/john/dev/pychess/main2/pychess/lib/pychess/widgets/ionest.py", line 43, in onPublished
    gamenanny.nurseGame(gmwidg, game)
  File "/home/john/dev/pychess/main2/pychess/lib/pychess/widgets/gamenanny.py", line 38, in nurseGame
    on_game_started(gamemodel, gmwidg)
  File "/home/john/dev/pychess/main2/pychess/lib/pychess/widgets/gamenanny.py", line 231, in on_game_started
    on_gmwidg_infront(gmwidg)  # setup menu items sensitivity
  File "/home/john/dev/pychess/main2/pychess/lib/pychess/widgets/gamenanny.py", line 63, in on_gmwidg_infront
    getWidgets()['window1'].set_title('%s - PyChess' % gmwidg.display_text)
  File "/home/john/dev/pychess/main2/pychess/lib/pychess/widgets/gamewidget.py", line 439, in display_text
    t = vs.join((self.player_display_text(color=WHITE),
  File "/home/john/dev/pychess/main2/pychess/lib/pychess/widgets/gamewidget.py", line 433, in player_display_text
    return repr(self.gamemodel.players[color])
IndexError: list index out of range

This is the data I pasted in (though it fails on other files too):

[Event "Local Event"]
[Site "Local Site"]
[Date "2014.08.11"]
[Round "1"]
[White "You"]
[Black "Guest"]
[Result "1-0"]
[TimeControl "300+0"]
[Time "19:33:00"]
[WhiteClock "0:02:50.121"]
[BlackClock "0:03:20.191"]
[PlyCount "41"]

1. e4 e5 2. Qh5 g5 3. Qxf7+ Kxf7 4. Bc4+ d5 5. Bxd5+ Qxd5 6. exd5 Bc5 7. a4 Kg6
8. a5 Kh5 9. Ra4 g4 10. f3 gxf3 11. gxf3 Bd7 12. Rg4 Be8 13. h4 Kh6 14. h5 Bxh5
15. Nh3 Be8 16. Nf2+ Bh5 17. Nh3 Ne7 18. Rg5 Nec6 19. d3 Bb6 20. Rg4+ Be3 21.
Bxe3# 1-0

I tried it on an earlier version of pychess (0.12rc1) and it worked OK.

Original issue reported on code.google.com by jcheetham19 on 7 Sep 2014 at 7:41

GoogleCodeExporter commented 9 years ago

Original comment by gbtami on 7 Sep 2014 at 9:28

GoogleCodeExporter commented 9 years ago
This issue was closed by revision 190fc1571d15.

Original comment by gbtami on 7 Sep 2014 at 10:03

GoogleCodeExporter commented 9 years ago
This issue was closed by revision f3377c7a1bbf.

Original comment by gbtami on 12 Sep 2014 at 6:12