ExportModelAsMpsFormat creates an unreadable char pointer in Python #4349
Labels
Help Needed
Modeling/Usage problem
Lang: Python
Python wrapper issue
Solver: Linear Solver
Related to all Linear Solver (GLOP, BOP, CBC etc...)
Milestone
What version of OR-Tools and what language are you using?
Version: main (9.10.4067 from the venv).
Language: Python
Which solver are you using (e.g. CP-SAT, Routing Solver, GLOP, BOP, Gurobi)
SCIP
What operating system (Linux, Windows, ...) and version?
Ubuntu 22.04 on kernel 5.18
What did you do?
Steps to reproduce the behavior:
I feel like opening the file as 'wb' instead of 'w' wouldn't solve the issue as I'd save the pointer object, not the pointed string. Can you confirm?
What did you expect to see
The program successfully saving the model to disk.
What did you see instead?
A ValueError exception.
Make sure you include information that can help us debug (full error message, model Proto).
I'm not sure what kind of information could be of use. The model is pretty big and it would be difficult to send here.
Anything else we should know about your project / environment
The ExportModelasLpFormat function works correctly returning a string. I am using Python3.9.19 in a venv.
Let me know if there is anything else that could be useful to know, or if I'm missing something.
Thanks in advance.
Best Regards,
Giacomo Guiduzzi
The text was updated successfully, but these errors were encountered: