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

Display of error empty: fmbt3-editor tries to search contents of byte String, but should search decoded string instead #81

Open
BLuedtke opened this issue Jan 24, 2022 · 0 comments

Comments

@BLuedtke
Copy link

BLuedtke commented Jan 24, 2022

Hello everyone,
I'm using the fmbt3-editor for creating python aal models. This issue concerns the devel branch (havent tested master), particularly utils3/fmbt3-editor. I am using Ubuntu 20.04 LTS.

When the model/code I invoke in fmbt3-editor throws an error, the view switches to the error tab. This is expected. There it says "Complete unformatted error output:". However, the error output after that is empty. In the console with which I started fmbt3-editor, I can see the error message being printed though. Interestingly, it is printed as a byte string, with the "b"-prefix.

In method _doGenerateTest of fmbt3-editor, the contents of this error (byte-) string are analyzed. This happens before showError is called, and here in _doGenerateTest, the _test_errormsg has to be set to the error message that should be displayed by showError.
In this method on line 1231 (of fmbt3-editor), it is checked whether some specific strings are contained in the error output (output[1] to be precise). Based on my tests, this check fails, and the method returns directly. However, if I change line 1231 to this:
if fmbt_exitstatus == 0 or "pass:" in output[1].decode('utf-8') or "inconc:" in output[1].decode('utf-8') or "fail:" in output[1].decode('utf-8'):
and change line 1239 to
self._test_errormsg = output[1].decode('utf-8')
then it works. Maybe one would also add a check for whether output[1] is None or Empty, to avoid exceptions here.

It seems like the "string in other string" search does not work if the string to search is a bytestring and not decoded. Now, I am not sure if this will be the same for every operating system. It could also depend on the version of python I suppose. There could also be other valid reasons for not decoding the string, which I haven't discovered yet.
As the fix is relatively easy, I'm fine with just modyfying the fmbt3-editor file on my machine, but fixing this in the repo would be more convenient. I'm kinda busy atm but if my stress cools down a bit, I could also submit a pull request.

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

1 participant