Skip to content

Commit

Permalink
Fix allowed types for save util (#1693)
Browse files Browse the repository at this point in the history
  • Loading branch information
araffin committed Sep 24, 2023
1 parent f4c5b1e commit b85fa75
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion stable_baselines3/common/save_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ def open_path(
"""
# Note(antonin): the true annotation should be IO[bytes]
# but there is not easy way to check that
allowed_types = (io.BufferedWriter, io.BufferedReader, io.BytesIO)
allowed_types = (io.BufferedWriter, io.BufferedReader, io.BytesIO, io.BufferedRandom)
if not isinstance(path, allowed_types):
raise TypeError(f"Path {path} parameter has invalid type: expected one of {allowed_types}.")
if path.closed:
Expand Down

0 comments on commit b85fa75

Please sign in to comment.