giulianoranalli / pywebsocket

Automatically exported from code.google.com/p/pywebsocket
0 stars 0 forks source link

pywebsocket dies on connect due to TypeError in BaseHTTPServer #101

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. <pywebsocketdir>/src/mod_pywebsocket/standalone.py -p 12345 -d 
<pywebsocketdir>/src/example/ --allow-draft75
2. open up <pywebsocketdir>/src/example/console.html in your browser
3. try to connect

What is the expected output? What do you see instead?
when i hit the connect button the standalone server throws an exception and 
prints the following stack trace:

[2011-06-30 00:52:09,267] [ERROR] root: Exception in processing request from: 
('127.0.0.1', 51932)
Traceback (most recent call last):
  File "/usr/lib/python2.7/SocketServer.py", line 582, in process_request_thread
    self.finish_request(request, client_address)
  File "/usr/lib/python2.7/SocketServer.py", line 323, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "./standalone.py", line 238, in __init__
    self, *args, **keywords)
  File "/usr/lib/python2.7/SocketServer.py", line 639, in __init__
    self.handle()
  File "/usr/lib/python2.7/BaseHTTPServer.py", line 343, in handle
    self.handle_one_request()
  File "/usr/lib/python2.7/BaseHTTPServer.py", line 313, in handle_one_request
    self.raw_requestline = self.rfile.readline(65537)
TypeError: readline() takes exactly 1 argument (2 given)

apache prints this warning:
[Thu Jun 30 00:55:37 2011] [warn] [client 127.0.0.1] mod_pywebsocket: 
web_socket_transfer_data raised exception for /echo: Connection read error

What version of the product are you using? On what operating system?
i used pywebsocket from svn and v0.6b1 as i needed draft version -07 for use in 
fx6+.

standalone.py and mod_pywebsockets run on ubuntu 11.04 with

kernel:
2.6.38-8-generic x86_64

Python:
Python 2.7.1+ (r271:86832, Apr 11 2011, 18:13:53).

Apache:
Server version: Apache/2.2.17 (Ubuntu)
Server built:   Feb 22 2011 18:35:08

mod_python:
Version: 3.3.1-9build2

Original issue reported on code.google.com by konrad.m...@googlemail.com on 29 Jun 2011 at 11:00

GoogleCodeExporter commented 9 years ago
Python 2.7 is not supported, but this bug must be fixed.

MemorizingFile.readline(self) should accept size parameter as 
socket._fileobject.readline does.

This crash happens because newer BaseHTTPServer.py calls readline with size 
parameter but MemorizingFile that wraps rfile set up by StreamRequestHandler 
doesn't accept size parameter.

Original comment by tyoshino@chromium.org on 4 Jul 2011 at 9:12

GoogleCodeExporter commented 9 years ago

Original comment by toyoshim@chromium.org on 7 Sep 2011 at 12:02

GoogleCodeExporter commented 9 years ago
Landed at r552

Original comment by toyoshim@chromium.org on 22 Sep 2011 at 8:24