Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#8179 defect closed duplicate (duplicate)

twistd web traceback when trailing slash is missing

Reported by: Thijs Triemstra Owned by:
Priority: normal Milestone:
Component: web Keywords:
Cc: Branch:
Author:

Description

I have a twistd web server running with twistd -no web --path=. on OSX 10.11 under Python 3.4.3 using Twisted svn trunk r46618.

When visiting a path without a trailing slash, e.g. http://localhost:8080/foo, I see the following traceback in the browser:

2016-01-18 17:01:49+0100 [HTTPChannel,1,127.0.0.1] Unhandled Error
	Traceback (most recent call last):
	  File "/Users/thijstriemstra/projects/twisted/twisted/protocols/basic.py", line 571, in dataReceived
	    why = self.lineReceived(line)
	  File "/Users/thijstriemstra/projects/twisted/twisted/web/http.py", line 1657, in lineReceived
	    self.allContentReceived()
	  File "/Users/thijstriemstra/projects/twisted/twisted/web/http.py", line 1736, in allContentReceived
	    req.requestReceived(command, path, version)
	  File "/Users/thijstriemstra/projects/twisted/twisted/web/http.py", line 762, in requestReceived
	    self.process()
	--- <exception caught here> ---
	  File "/Users/thijstriemstra/projects/twisted/twisted/web/server.py", line 183, in process
	    self.render(resrc)
	  File "/Users/thijstriemstra/projects/twisted/twisted/web/server.py", line 234, in render
	    body = resrc.render(self)
	  File "/Users/thijstriemstra/projects/twisted/twisted/web/resource.py", line 250, in render
	    return m(request)
	  File "/Users/thijstriemstra/projects/twisted/twisted/web/static.py", line 577, in render_GET
	    return self.redirect(request)
	  File "/Users/thijstriemstra/projects/twisted/twisted/web/static.py", line 613, in redirect
	    return redirectTo(addSlash(request), request)
	  File "/Users/thijstriemstra/projects/twisted/twisted/web/static.py", line 66, in addSlash
	    qindex = request.uri.find('?')
	builtins.TypeError: 'str' does not support the buffer interface

Change History (2)

comment:1 Changed 2 years ago by Adi Roiban

Resolution: duplicate
Status: newclosed

Looks like a duplicate of #8169

comment:2 Changed 2 years ago by Thijs Triemstra

Oops, thanks!

Note: See TracTickets for help on using tickets.