simon-budig / woof

an ad-hoc single file webserver
120 stars 17 forks source link

Crashing on python 3.9.6 #7

Closed Dlanis closed 3 years ago

Dlanis commented 3 years ago
Now serving on http://192.168.0.3:8091/1.tar.gz
192.168.0.100 - - [09/Jul/2021 00:42:12] "GET /1.tar.gz HTTP/1.1" 200 -
[Errno 104] Connection reset by peer
Connection broke. Aborting
Exception ignored in: <function _Stream.__del__ at 0x7f9901c31f70>
Traceback (most recent call last):
  File "/usr/lib/python3.9/tarfile.py", line 410, in __del__
    self.close()
  File "/usr/lib/python3.9/tarfile.py", line 460, in close
    self.fileobj.write(self.buf)
  File "/usr/lib/python3.9/socketserver.py", line 826, in write
    self._sock.sendall(b)
OSError: [Errno 9] Bad file descriptor
192.168.0.100 - - [09/Jul/2021 00:42:14] "GET /1.tar.gz HTTP/1.1" 200 -
[Errno 104] Connection reset by peer
Connection broke. Aborting
Exception ignored in: <function _Stream.__del__ at 0x7f9901c31f70>
Traceback (most recent call last):
  File "/usr/lib/python3.9/tarfile.py", line 410, in __del__
    self.close()
  File "/usr/lib/python3.9/tarfile.py", line 460, in close
    self.fileobj.write(self.buf)
  File "/usr/lib/python3.9/socketserver.py", line 826, in write
    self._sock.sendall(b)
OSError: [Errno 9] Bad file descriptor
CoolCat467 commented 3 years ago

This may have something to do with the particular file you are trying to send because of file descriptor error. Especially since it appears to have been caused by something tarfile was trying to send ending up being sent by server.

simon-budig commented 3 years ago

This may have something to do with the particular file you are trying to send because of file descriptor error. Especially since it appears to have been caused by something tarfile was trying to send ending up being sent by server.

I agree, this kind of error happens when the remote side cancels the transfer.

Arguably I could try to catch that error and give a nicer error message.

Dlanis commented 3 years ago

Now works nice,,,