aiplan4eu / unified-planning

The AIPlan4EU Unified Planning Library
Apache License 2.0
181 stars 39 forks source link

Update pddl_planner.py - added errors='ignore' in byte string decode … #620

Open VladKlimen opened 1 month ago

VladKlimen commented 1 month ago

…in solve_

I tried to run some solver and the only problem was the exception that was thrown because of encoding failure of out_err_bytes, that anyway goes to logs and not critical to lack some non-unicode characters

mikand commented 2 days ago

Hi @VladKlimen,

thanks for this PR and for signaling the issue. I was wandering if ignoring the non-utf-8 characters is a good idea in general: Python offers other ways such as replacing: https://docs.python.org/3/library/codecs.html#error-handlers. Having pieces of outputs magically disappear from the logs might not be great, maybe replacing is a better option?

@arbimo @roeger Any thoutghs on this?

arbimo commented 21 hours ago

Hi, I am not particularly familiar with this part of the code but in general in would agree with Andrea and favor replacing the character with UTF-8 ? (�), as supported by the python function. For me that immediately makes the problem obvious and suggests an encoding problem.