lichess.org
Donate

PGN is not valid if it contains 0-0-0+ (castling with check)

I'm pasting my game into Tools -> Import game. Both file upload and copy-paste result in the same error.
I just quickly went on analysis board and made a couple random moves:
1. d4 e5 2. dxe5 d6 3. exd6 Na6 4. dxc7 Qxd1+
5. Kxd1 Nxc7 6. Nf3 Bg4 7. h3 O-O-O+ 8. Bd2 Bxf3
9. gxf3

I then pasted that in the Tools -> Import Game feature and it worked. As @Toadofsky said please paste the PGN, probably an error somewhere else.
It fails if you notate the castling with zeroes as in the title. 0-0-0 with no + is accepted.
Write O-O-O+ instead... Is 0-0-0 even valid PGN? I'm curious.
@Unihedron yes it may be treated valid (as import format) by the parser.

"8.2.3.7: Import and export SAN

PGN export format always uses the above canonical SAN to represent moves in the movetext section of a PGN game. Import format is somewhat more relaxed and it makes allowances for moves that do not conform exactly to the canonical format. However, these allowances may differ among different PGN reader programs. Only data appearing in export format is in all cases guaranteed to be importable into all PGN readers.

There are a number of suggested guidelines for use with implementing PGN reader software for permitting non-canonical SAN move representation. The idea is to have a PGN reader apply various transformations to attempt to discover the move that is represented by non-canonical input. Some suggested transformations include: letter case remapping, capture indicator insertion, check indicator insertion, and checkmate indicator insertion."
[Event "3m+2s, unrated"]
[White "Guest2644712"]
[Black "Guest2644402"]
[Site "Café"]
[Round ""]
[Annotator ""]
[Result "1-0"]
[Date "2018.12.22"]
[PlyCount "131"]

1. e4 {[%emt 0:0:2]} d5 {[%emt 0:0:1]} 2. exd5 {[%emt 0:0:2]} Qxd5 {[%emt 0:0:1]} 3. Nc3 {[%emt 0:0:0]} Qe5+ {[%emt 0:0:2]} 4. Be2 {[%emt 0:0:3]} c6 {[%emt 0:0:1]} 5. Nf3 {[%emt 0:0:1]} Qc7 {[%emt 0:0:1]} 6. d4 {[%emt 0:0:3]} Bf5 {[%emt 0:0:1]} 7. Ne5 {[%emt 0:0:11]} e6 {[%emt 0:0:2]} 8. g4 {[%emt 0:0:2]} Bg6 {[%emt 0:0:2]} 9. Bc4 {[%emt 0:0:7]} h5 {[%emt 0:0:16]} 10. g5 {[%emt 0:0:3]} Nd7 {[%emt 0:0:4]} 11. Bf4 {[%emt 0:0:2]} Bd6 {[%emt 0:0:1]} 12. Nxg6 {[%emt 0:0:21]} fxg6 {[%emt 0:0:4]} 13. Bg3 {[%emt 0:0:12]} 0-0-0 {[%emt 0:0:11]} 14. Bxe6 {[%emt 0:0:2]} Re8 {[%emt 0:0:1]} 15. d5 {[%emt 0:0:5]} cxd5 {[%emt 0:0:1]} 16. Qxd5 {[%emt 0:0:2]} Bxg3 {[%emt 0:0:34]} 17. hxg3 {[%emt 0:0:3]} Ne7 {[%emt 0:0:15]} 18. Qxd7+ {[%emt 0:0:15]} Qxd7 {[%emt 0:0:1]} 19. Bxd7+ {[%emt 0:0:1]} Kxd7 {[%emt 0:0:1]} 20. 0-0-0+ {[%emt 0:0:0]} Kc8 {[%emt 0:0:4]} 21. Rhe1 {[%emt 0:0:2]} Nc6 {[%emt 0:0:2]} 22. Nb5 {[%emt 0:0:6]} Rxe1 {[%emt 0:0:10]} 23. Rxe1 {[%emt 0:0:0]} Rf8 {[%emt 0:0:8]} 24. Nd6+ {[%emt 0:0:6]} Kc7 {[%emt 0:0:8]} 25. Ne4 {[%emt 0:0:1]} Ne5 {[%emt 0:0:8]} 26. f4 {[%emt 0:0:4]} Nf3 {[%emt 0:0:11]} 27. Re3 {[%emt 0:0:14]} Nd4 {[%emt 0:0:5]} 28. Rd3 {[%emt 0:0:2]} Nf5 {[%emt 0:0:5]} 29. Nc5 {[%emt 0:0:3]} Re8 {[%emt 0:0:14]} 30. Kd2 {[%emt 0:0:2]} Re7 {[%emt 0:0:7]} 31. Nb3 {[%emt 0:0:9]} b6 {[%emt 0:0:3]} 32. Nd4 {[%emt 0:0:1]} Nd6 {[%emt 0:0:7]} 33. b3 {[%emt 0:0:15]} a6 {[%emt 0:0:8]} 34. Re3 {[%emt 0:0:5]} Ne4+ {[%emt 0:0:19]} 35. Kd3 {[%emt 0:0:11]} Nf2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t 0:0:1]} 62. Nd2 {[%emt 0:0:17]} Ne2 {[%emt 0:0:9]} 63. f5 {[%emt 0:0:4]} Ng1 {[%emt 0:0:2]} 64. Nf1 {[%emt 0:0:2]} h3 {[%emt 0:0:1]} 65. f6 {[%emt 0:0:2]} Kd7 {[%emt 0:0:2]} 66. Kg7 {[%emt 0:0:2]Tijd '} 1-0

If I remove + on 20th move, it works.

This topic has been archived and can no longer be replied to.