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

Can disable interactive debugging? Segfault on when run in PyCharm. #88

Open
allComputableThings opened this issue May 7, 2020 · 1 comment

Comments

@allComputableThings
Copy link

With this script to generate a prolog exception:

from pyswip.prolog import Prolog, PrologError
def problem(prolog):
    try:
        next(prolog.assertz(f"a23123 s  "))
    except PrologError as e:
        pass
    except Exception as e:
        raise

for x in range(200):     problem(Prolog())

running:

python pytest.py
ERROR: Syntax error: Operator expected
ERROR: assertz((a23123
ERROR: ** here **
ERROR:  s  )). 
   Call: (1) pyrun([a, s, s, e, r, t, z, '('|...], _1904) ? 

enters Prolog's interactive debugger.
When called from within PyCharm, the interactive prompt doesn't seem supported and the program segfaults somewhere internal to prolog.

Any ideas on how to disable interactive debugging?

@allComputableThings allComputableThings changed the title Can disable a interactive debugging? Can disable interactive debugging? Segfault on when run in PyCharm. May 7, 2020
@allComputableThings
Copy link
Author

Neither of:

    args.append("--no-tty") 
    args.append("--tty=false") 

in initialize fixes this. Are the not correctly loaded into the initialize call. (Perhaps not -- these options dont seem to disable interactive input at the command line for swipl).

Also -- the bug goes away in PyCharm when "Emulate terminal in output console" is enabled in the run configuration.

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