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

Parser issue #1

Open
MostafaGomaa opened this issue Nov 7, 2022 · 1 comment
Open

Parser issue #1

MostafaGomaa opened this issue Nov 7, 2022 · 1 comment

Comments

@MostafaGomaa
Copy link

Dear maintainers,

Thanks for the work invested in the repo.

When I try to use translate.py with python3 it seems like the parser gets stuck in infinite recursive calls.
python3 $TFD_HOME/translate/translate.py domain.pddl problem.pddl

.....
  File "...TemporalFastDownward/downward/translate/pddl/pddl_file.py", line 15, in parse_pddl_file
    return parser.parse_nested_list(open(filename))
  File "...TemporalFastDownward/downward/translate/pddl/pddl_file.py", line 44, in open
    domain_pddl = parse_pddl_file("domain", domain_filename)
  File "...TemporalFastDownward/downward/translate/pddl/pddl_file.py", line 15, in parse_pddl_file
    return parser.parse_nested_list(open(filename))
  File "...TemporalFastDownward/downward/translate/pddl/pddl_file.py", line 44, in open
    domain_pddl = parse_pddl_file("domain", domain_filename)
  File "...TemporalFastDownward/downward/translate/pddl/pddl_file.py", line 15, in parse_pddl_file
    return parser.parse_nested_list(open(filename))
  File "...TemporalFastDownward/downward/translate/pddl/pddl_file.py", line 44, in open
    domain_pddl = parse_pddl_file("domain", domain_filename)
  File "...TemporalFastDownward/downward/translate/pddl/pddl_file.py", line 15, in parse_pddl_file
    return parser.parse_nested_list(open(filename))
  File "...TemporalFastDownward/downward/translate/pddl/pddl_file.py", line 44, in open
    domain_pddl = parse_pddl_file("domain", domain_filename)
  File "...TemporalFastDownward/downward/translate/pddl/pddl_file.py", line 15, in parse_pddl_file
    return parser.parse_nested_list(open(filename))
  File "...TemporalFastDownward/downward/translate/pddl/pddl_file.py", line 44, in open
    domain_pddl = parse_pddl_file("domain", domain_filename)
  File "..TemporalFastDownward/downward/translate/pddl/pddl_file.py", line 15, in parse_pddl_file
    return parser.parse_nested_list(open(filename))
  File "...TemporalFastDownward/downward/translate/pddl/pddl_file.py", line 44, in open
    domain_pddl = parse_pddl_file("domain", domain_filename)
  File "...TemporalFastDownward/downward/translate/pddl/pddl_file.py", line 15, in parse_pddl_file
    return parser.parse_nested_list(open(filename))
  File "...TemporalFastDownward/downward/translate/pddl/pddl_file.py", line 44, in open
    domain_pddl = parse_pddl_file("domain", domain_filename)
  File "...TemporalFastDownward/downward/translate/pddl/pddl_file.py", line 15, in parse_pddl_file
    return parser.parse_nested_list(open(filename))
  File "...TemporalFastDownward/downward/translate/pddl/pddl_file.py", line 34, in open
    dirname, basename = os.path.split(task_filename)
  File "/usr/lib/python3.9/posixpath.py", line 104, in split
    sep = _get_sep(p)
  File "/usr/lib/python3.9/posixpath.py", line 42, in _get_sep
    if isinstance(path, bytes):

As far as I could dig, this seems to be caused by the change

982e9a4#diff-00f68d6d7b9e60fd1c9500c7436acddf2c2feb8277faa3eb0120bb7e5ac8170bR14

- return parser.parse_nested_list(file(filename))
+ #return parser.parse_nested_list(file(filename))
+ return parser.parse_nested_list(open(filename))

Am I missing something obvious?

@LonyuNaz
Copy link

LonyuNaz commented Jun 4, 2024

I don't know if you fixed this already, but I think open(filename) was meant to use the builtin open() function of python, instead of pddl.open() which it does.

How I managed to fix this:

import io

return parser.parse_nested_list(io.open(filename))

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

2 participants