{"action":"opened","issue":{"url":"https://api.github.com/repos/pychess/pychess/issues/1479","repository_url":"https://api.github.com/repos/pychess/pychess","labels_url":"https://api.github.com/repos/pychess/pychess/issues/1479/labels{/name}","comments_url":"https://api.github.com/repos/pychess/pychess/issues/1479/comments","events_url":"https://api.github.com/repos/pychess/pychess/issues/1479/events","html_url":"https://github.com/pychess/pychess/issues/1479","id":266308043,"number":1479,"title":"Tag TimeControl + Unloadable game","user":{"login":"ecrucru","id":24614488,"avatar_url":"https://avatars0.githubusercontent.com/u/24614488?v=4","gravatar_id":"","url":"https://api.github.com/users/ecrucru","html_url":"https://github.com/ecrucru","followers_url":"https://api.github.com/users/ecrucru/followers","following_url":"https://api.github.com/users/ecrucru/following{/other_user}","gists_url":"https://api.github.com/users/ecrucru/gists{/gist_id}","starred_url":"https://api.github.com/users/ecrucru/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ecrucru/subscriptions","organizations_url":"https://api.github.com/users/ecrucru/orgs","repos_url":"https://api.github.com/users/ecrucru/repos","events_url":"https://api.github.com/users/ecrucru/events{/privacy}","received_events_url":"https://api.github.com/users/ecrucru/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-10-17T23:06:21Z","updated_at":"2017-10-17T23:06:21Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"Hello,\r\n\r\nI have several problems with the following game that I lost against my little engine. I wanted to analyze it with pyChess for the first time.\r\n\r\n```\r\n[Event \"Fun\"]\r\n[Site \"Home\"]\r\n[Date \"2017-10-17\"]\r\n[Round \"?\"]\r\n[White \"Me\"]\r\n[Black \"AntiCrux 0.3.0 - Level 8\"]\r\n[Result \"0-1\"]\r\n[PlyCount \"63\"]\r\n[Variant \"suicide\"]\r\n[TimeControl \"-\"]\r\n[Termination \"normal\"]\r\n\r\n1. b3 d5 2. g4 Bcxg4 3. e4 dxe4 4. Qxg4 Qxd2 5. Qxg7 Bxg7\r\n6. Bcxd2 Bxa1 7. Ngf3 e4xf3 8. Bfg2 f3xg2 9. Bc1 gxh1=N\r\n10. Kd1 Nhxf2 11. h3 Nfxd1 12. Nc3 Bxc3 13. Bb2 Ndxb2\r\n14. b4 Bxb4 15. a3 Bxa3 16. c4 Nb2xc4 17. h4 Kf8 18. h5 Ngf6\r\n19. h6 Kg7 20. hxg7 Nfh5 21. gxh8=K Bb2 22. Kxh7 Bh8\r\n23. Kxh8 Nhg7 24. Kxg7 Nbd7 25. Kxf7 Rd8 26. Kxe7 Ndb8\r\n27. Kxd8 Ncd6 28. Kxc7 Ndb5 29. Kxb7 Nb5d6 30. Kxa7 Ndc8\r\n31. Kxb8 Na7 32. Kxa7# 0-1\r\n```\r\n\r\nThe tag `TimeControl` is correct according to the specification :\r\n\r\n```\r\nThere are six kinds of TimeControl fields.\r\n(...)\r\nThe second kind is a single hyphen (\"-\") which means that there was no time\r\ncontrol mode in use. When used, it is usually the only descriptor present.\r\n```\r\n\r\nThis game cannot be opened by pyChess latest-git because the TimeControl `-` is not handled correctly :\r\n\r\n```\r\nTraceback (most recent call last):\r\n  File \"/home/ecrucru/pychess/lib/pychess/perspectives/database/PreviewPanel.py\", line 98, in on_selection_changed\r\n    self.persp.chessfile.loadToModel(rec, -1, self.gamemodel)\r\n  File \"/home/ecrucru/pychess/lib/pychess/Savers/pgn.py\", line 662, in loadToModel\r\n    secs, gain = parseTimeControlTag(model.tags['TimeControl'])\r\nTypeError: 'NoneType' object is not iterable\r\n```\r\n\r\nI face different cases :\r\n\r\n- pyChess Linux latest-git :\r\n\t- Tag '-' : error in console=**yes**, openable=**no**, preview=no\r\n\t- Tag '5' : error in console=no, openable=**no**, preview=yes\r\n\t- No tag  : error in console=no, openable=**no**, preview=yes\r\n- pyChess Windows 0.99.0 :\r\n\t- Tag '-' : error in console=??, openable=**no**, preview=no\r\n\t- Tag '5' : error in console=??, openable=yes, preview=yes\r\n\t- No tag  : error in console=??, openable=yes, preview=yes\r\n\r\n\"Openable\" means double-clicking on the file from the database.\r\n\r\nThe problem is not only fixing [pgn.py@parseTimeControlTag](https://github.com/pychess/pychess/blob/master/lib/pychess/Savers/pgn.py#L123) or not processing the tag if it contains `?` or `-`. The PGN game is principally not loadable in the latest release (regression ?).\r\n\r\nThanks."}}
{"actor":{"display_login":"ecrucru"}}