Skip to content

[BUG] (play_gui) wrapped env accesses non-existent actions #22

@IbrahimElk

Description

@IbrahimElk

🐛 Bug

inside minihack/scripts/play_gui.py
which can be run via python -m minihack.scripts.play_gui
has the following code snippet inside the key_handler

        try:
            action = env.actions.index(ch)
            step(action)

but the env is wrapped by gymnasium with PassiveEnvChecker
which doesn't expose the instance attribute actions.

I don't know why it isn't exposed, but this is the solution that i used to fix this:

        try:
            action = env.unwrapped.actions.index(ch)
            step(action)

To Reproduce

Steps to reproduce the behavior:

  1. pip install minihack
  2. python -m minihack.scripts.play_gui

The error message:

lay_gui.py", line 54, in key_handler
    action = env.actions.index(ch)
AttributeError: 'PassiveEnvChecker' object has no attribute 'actions'

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions