Pithikos / python-websocket-server

A simple fully working websocket-server in Python with no external dependencies
MIT License
1.14k stars 381 forks source link

need more than 0 values to unpack #29

Closed mboo2005 closed 6 years ago

mboo2005 commented 6 years ago

valueError: need more than 0 values to unpack happens When client disconnected. I found that the reason is:

    def read_bytes(self, num):
        bytes = self.rfile.read(num)  #in python2.7 bytes get '' (empty string)
        if (sys.version_info[0] < 3):
            return map(ord, bytes) #ValueError when bytes is empty 
mboo2005 commented 6 years ago

The client did not close connection before disconnection such as process quite