Skip to content

Commit 2379c55

Browse files
committed
Link open() docs rather than recommendeing replace
1 parent cff414b commit 2379c55

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

chess/pgn.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1466,14 +1466,11 @@ def read_game(handle: TextIO, *, Visitor: Any = GameBuilder) -> Any:
14661466
By using text mode, the parser does not need to handle encodings. It is the
14671467
caller's responsibility to open the file with the correct encoding.
14681468
PGN files are usually ASCII or UTF-8 encoded, sometimes with BOM (which
1469-
this parser automatically ignores).
1469+
this parser automatically ignores). See :func:`open` for options to
1470+
deal with encoding errors.
14701471
14711472
>>> pgn = open("data/pgn/kasparov-deep-blue-1997.pgn", encoding="utf-8")
14721473
1473-
If you get a UnicodeDecodeError, including the following parameters might help:
1474-
1475-
>>> pgn = open("data/pgn/kasparov-deep-blue-1997.pgn", 'r', errors='replace')
1476-
14771474
Use :class:`~io.StringIO` to parse games from a string.
14781475
14791476
>>> import io

0 commit comments

Comments
 (0)