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't convert int object to str implicitly #5

Closed
tomaszgy opened this issue Nov 23, 2016 · 2 comments
Closed

Can't convert int object to str implicitly #5

tomaszgy opened this issue Nov 23, 2016 · 2 comments

Comments

@tomaszgy
Copy link
Contributor

Hello,

I have been using your package recently (a nice one, btw 👍 ) and just discovered something that looks to like a tiny bug. While passing timeout to pymzn.minizinc() function with the default gecode solver, I get:

Traceback (most recent call last):
  File "main.py", line 39, in <module>
    main()
  File "main.py", line 36, in main
    run_test_cases()
  File "main.py", line 28, in run_test_cases
    schedule = run_solver(**test_case, debug=True)
  File "/Users/me/my_project/minizinc_service.py", line 74, in run_solver
    timeout=1000)
  File "/usr/local/lib/python3.5/site-packages/pymzn/_mzn/_minizinc.py", line 169, in minizinc
    all_solutions=all_solutions, **solver_args)
  File "/usr/local/lib/python3.5/site-packages/pymzn/_mzn/_solvers.py", line 212, in solve
    process = run(args)
  File "/usr/local/lib/python3.5/site-packages/pymzn/bin.py", line 105, in run
    preexec_fn=os.setsid) as process:
  File "/usr/local/Cellar/python3/3.5.2_3/Frameworks/Python.framework/Versions/3.5/lib/python3.5/subprocess.py", line 947, in __init__
    restore_signals, start_new_session)
  File "/usr/local/Cellar/python3/3.5.2_3/Frameworks/Python.framework/Versions/3.5/lib/python3.5/subprocess.py", line 1490, in _execute_child
    restore_signals, start_new_session, preexec_fn)
TypeError: Can't convert 'int' object to str implicitly

As it seemed like there was a typo here, I did a quick fix, and tried it locally. It did the job for me so I'll leave a PR in few minutes in case you find it useful :) Cheers!

@paolodragone
Copy link
Owner

Thank you! :)

@tomaszgy
Copy link
Contributor Author

No problem :)

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