import gymnasium as gym
game_name = 'ALE/MontezumaRevenge-v5'
env = gym.make(game_name, render_mode="human")
obs, _ = env.reset()
env.close()
import time
print("sleeping")
time.sleep(5)
What's expected is that the game would open and close, you'd see text "sleeping", and after 5s, the program exits. What actually happens is that the game window stays up for 5s, after which the program exits. The actual game renders properly until you try to close it, this example does not demonstrate that part since it is working as expected.
This bug is made worse in Jupyter, where this causes the Python kernel to crash if you try to render the game.
What's expected is that the game would open and close, you'd see text "sleeping", and after 5s, the program exits. What actually happens is that the game window stays up for 5s, after which the program exits. The actual game renders properly until you try to close it, this example does not demonstrate that part since it is working as expected.
This bug is made worse in Jupyter, where this causes the Python kernel to crash if you try to render the game.
Using version 0.8.1 on Ubuntu 22.04.