coreosbr / web-shell

Automatically exported from code.google.com/p/web-shell
0 stars 0 forks source link

FIX: backtrace error: shutdown() takes exactly 0 arguments #67

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. install web-shell on fedora 15 (py2.7)
2. start ./webshell.py
3. make a request

What is the expected output? What do you see instead?

Traceback (most recent call last):
  File "./webshell.py", line 1426, in <module>
    main()
  File "./webshell.py", line 1420, in main
    httpd.serve_forever()
  File "/usr/lib64/python2.7/SocketServer.py", line 227, in serve_forever
    self._handle_request_noblock()
  File "/usr/lib64/python2.7/SocketServer.py", line 287, in _handle_request_noblock
    self.shutdown_request(request)
  File "/usr/lib64/python2.7/SocketServer.py", line 459, in shutdown_request
    request.shutdown(socket.SHUT_WR)
TypeError: shutdown() takes exactly 0 arguments (1 given)

FIX:
I fixed this by editing line 459 of SocketServer.py and replacing 
(socket.SHUT_WR) with ()
I am not sure this is a great fix, but it gets web-shell working.
cheers -

Original issue reported on code.google.com by greenpot...@gmail.com on 19 Aug 2011 at 2:00

GoogleCodeExporter commented 9 years ago
The issue is due to a bug in SocketServer for 2.7.  You can install Python 2.6 
to get around this issue.  When you do that modify line 1 for webshell.py to 
point to python2.6.  I did this on Ubuntu 11.10 Oneiric successfully.

I did find it disappointing that this shell didn't have a desktop version of 
itself.

Original comment by shi...@elite-systems.org on 19 Mar 2012 at 11:17

GoogleCodeExporter commented 9 years ago
Getting rid of the argument in SocketServer.py causes loads more exceptions 
than it prevents (maybe not in web-shelol bt in a bunch of other things that 
use it). Ideally you'd not hack a python core library at all, but if it can't 
be avoided you should preserve the original behaviour and catch any exceptions 
generated e.g.

        except TypeError:
            request.shutdown()

Original comment by technica...@gmail.com on 10 Sep 2012 at 9:08