Skip to content

writeBestSol method not working #570

@kothariharshit

Description

@kothariharshit
from pyscipopt import Model
model = Model("Example") 
x = model.addVar("x")
y = model.addVar("y", vtype="INTEGER")
model.setObjective(x + y)
model.addCons(2*x - y >= 0)
model.optimize()
model.writeBestSol(filename="origprob.sol", write_zeros=True)

This leads to the following error.

OSError: [Errno 9] Bad file descriptor

I also noticed that the solution file is created, and has the correct solution, but still the code terminates with this OSerror.
(I am using MacOS). Please let me know if any other information is needed. Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions