Closed jordanbray closed 9 years ago
Hi, thanks for reporting this! I am assuming you're using version 0.8.1.
On the first glance this looks like the moving piece is neither pawn, knight, bishop, rook, queen or king, which is not possible. Has to be some deeper problem ...
Can you please provide the entire list of moves to help reproduce it?
This is a user error. I just found the bug in my code. When I was adding moves to the PGN, I was repetedly calling add_main_variation
. This was basically telling the PGN software that each move was the first move in the game, many of which were illegal.
I'll find my way through the documentation to figure out the correct way to add a move. Thanks for the other bug fix.
Alright! I'll add an assertion there, to make the error message a bit clearer. UnboundLocalError
really looks like a problem with the library.
Hey,
I've been trying to create a PGN from a game played (engine vs engine) through python-chess.
However, whenever I convert the pgn to a string, I get a stack trace back.
This occurs here in my code:
update the PGN
I can add moves, just not get the PGN string back.
As you can see above, I also tried the PGN exporter, but that failed with the same exception.