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

status(): I/O operation on closed file. #71

Closed
happyleavesaoc opened this issue May 9, 2016 · 2 comments
Closed

status(): I/O operation on closed file. #71

happyleavesaoc opened this issue May 9, 2016 · 2 comments

Comments

@happyleavesaoc
Copy link

Hi, I think this issue is related to some of the others (#31, #64). After some time of working great, I consistently get this exception:

  File "example.py", line 90, in update
    self.status = self.client.status()
  File "mpd.py", line 629, in decorator
    return wrapper(self, name, args, bound_decorator(self, returnValue))
  File "mpd.py", line 252, in _execute
    self._write_command(command, args)
  File "mpd.py", line 279, in _write_command
    self._write_line(" ".join(parts))
  File "mpd.py", line 258, in _write_line
    self._wfile.write("%s\n" % line)
ValueError: I/O operation on closed file.

It is connected to a mopidy instance, which continues to function. I suspect the connection is broken, but I'm not sure if mpd2 should handle this, or I should proceed like the users in the referenced issues and reconnect myself.

@Mic92
Copy link
Owner

Mic92 commented May 11, 2016

we had this discussion in #31, with the current synchronous api it is hard to implement custom error logic, which fits everyone's need. You may find this wrapper useful: https://github.com/schamp/PersistentMPDClient

@happyleavesaoc
Copy link
Author

Ok, thanks for the confirmation! I'll handle the error in my application code.

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