Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not work installed to a domain subdirectory #1

Open
jhanley-com opened this issue Sep 11, 2022 · 0 comments
Open

Does not work installed to a domain subdirectory #1

jhanley-com opened this issue Sep 11, 2022 · 0 comments

Comments

@jhanley-com
Copy link

I cloned your repo and then published it to my site as https://cdn.jhanley.com/ChessMatchViewer/chess.html

The problem is caused by publishing the project to the subdirectory "ChessMatchViewer".

The following error is displayed:

error during pgn parsing Traceback (most recent call last): File "/lib/python3.10/site-packages/chess/pgn.py", line 1682, in read_game move = visitor.parse_san(board_stack[-1], token) File "/lib/python3.10/site-packages/chess/pgn.py", line 1059, in parse_san return board.parse_san(san) File "/lib/python3.10/site-packages/chess/__init__.py", line 3038, in parse_san raise ValueError(f"illegal san: {san!r} in {self.fen()}") ValueError: illegal san: 'h1' in rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1

The solution is to make the ".pgn" files relative.

Changes for chess_script.py. Change the paths from "/" to "./".

Line 86:

def load_games(pgn_location = "./kasparov-deep-blue-1997.pgn"):

Line 158:

files = ["./spassky_bronstein_1960.pgn", "./fischer_larsen_1971.pgn", "./kasparov-deep-blue-1997.pgn"]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant