{"action":"opened","issue":{"url":"https://api.github.com/repos/cvxopt/cvxopt/issues/47","labels_url":"https://api.github.com/repos/cvxopt/cvxopt/issues/47/labels{/name}","comments_url":"https://api.github.com/repos/cvxopt/cvxopt/issues/47/comments","events_url":"https://api.github.com/repos/cvxopt/cvxopt/issues/47/events","html_url":"https://github.com/cvxopt/cvxopt/issues/47","id":121321029,"number":47,"title":"Mosek interface prints empty lines with suppressed output","user":{"login":"pettni","id":4883481,"avatar_url":"https://avatars.githubusercontent.com/u/4883481?v=3","gravatar_id":"","url":"https://api.github.com/users/pettni","html_url":"https://github.com/pettni","followers_url":"https://api.github.com/users/pettni/followers","following_url":"https://api.github.com/users/pettni/following{/other_user}","gists_url":"https://api.github.com/users/pettni/gists{/gist_id}","starred_url":"https://api.github.com/users/pettni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pettni/subscriptions","organizations_url":"https://api.github.com/users/pettni/orgs","repos_url":"https://api.github.com/users/pettni/repos","events_url":"https://api.github.com/users/pettni/events{/privacy}","received_events_url":"https://api.github.com/users/pettni/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-12-09T19:31:17Z","updated_at":"2015-12-09T19:31:17Z","closed_at":null,"body":"The following minimal example reproduces the bug:\r\n\r\n```python\r\nimport mosek\r\nfrom cvxopt import msk, matrix\r\n\r\nA = matrix([[1.,0.],[0.,1.]])\r\nb = matrix([1.,1.])\r\nc = matrix([-1.,-1.])\r\n\r\nmsk.options = {mosek.iparam.log: 0} # supposed to suppress output\r\nmsk.lp(c,A,b) # prints four empty lines.\r\n```\r\n\r\nThis is a bug related to Mosek internals, but can easily be fixed by redefining `streamprinter()` in `msk.py` ([here](https://github.com/cvxopt/cvxopt/blob/master/src/python/msk.py#L30)) as follows:\r\n\r\n```python\r\ndef streamprinter(text): \r\n    sys.stdout.write(text) \r\n    sys.stdout.flush() \r\n```\r\nThis is the stream printer used in [mosek tutorials](http://docs.mosek.com/7.1/pythonapi/Linear_optimization.html)."}}