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

Model setLogFile(None) error #811

Closed
liangbug opened this issue Mar 11, 2024 · 3 comments
Closed

Model setLogFile(None) error #811

liangbug opened this issue Mar 11, 2024 · 3 comments

Comments

@liangbug
Copy link
Contributor

Describe the bug
m.setLogfile(None) occurs an error below
Traceback (most recent call last):
.......
m.setLogfile(None)
File "src\pyscipopt\scip.pxi", line 4858, in pyscipopt.scip.Model.setLogfile
TypeError: expected bytes, NoneType found

To Reproduce

from pyscipopt import Model

m = Model()
x = m.addVar(name='x', vtype='I')
y = m.addVar(name='y', vtype='I')
m.addCons(x+2*y <= 3)
m.addCons(2*x+y <= 3)
m.setObjective(x+y, 'maximize')
m.setLogfile('opt.log')
m.optimize()
m.setLogfile(None)
m.writeStatistics('stat.log')   

Expected behavior
m.setLogfile(None) stop log the file and no error occurs.

Screenshots
The fixed code
image

System

  • OS: Win10
  • Version 22H2
  • SCIP version 8.0.3
  • How did you install pyscipopt? pip install pyscipopt==4.4.0

Additional context
Add any other context about the problem here.

@Joao-Dionisio
Copy link
Collaborator

Joao-Dionisio commented Mar 11, 2024

Hello, @liangbug! Can you please create a PR with your proposed changes? This seems useful if I understood it correctly :)

@liangbug
Copy link
Contributor Author

Hi, @Joao-Dionisio, I created a PR #813 .

@Joao-Dionisio
Copy link
Collaborator

Fixed in #813.

Thank you @liangbug!

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