Opened 3 years ago

Closed 3 years ago

Last modified 3 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:


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,] Unhandled Error
	Traceback (most recent call last):
	  File "/Users/thijstriemstra/projects/twisted/twisted/protocols/", line 571, in dataReceived
	    why = self.lineReceived(line)
	  File "/Users/thijstriemstra/projects/twisted/twisted/web/", line 1657, in lineReceived
	  File "/Users/thijstriemstra/projects/twisted/twisted/web/", line 1736, in allContentReceived
	    req.requestReceived(command, path, version)
	  File "/Users/thijstriemstra/projects/twisted/twisted/web/", line 762, in requestReceived
	--- <exception caught here> ---
	  File "/Users/thijstriemstra/projects/twisted/twisted/web/", line 183, in process
	  File "/Users/thijstriemstra/projects/twisted/twisted/web/", line 234, in render
	    body = resrc.render(self)
	  File "/Users/thijstriemstra/projects/twisted/twisted/web/", line 250, in render
	    return m(request)
	  File "/Users/thijstriemstra/projects/twisted/twisted/web/", line 577, in render_GET
	    return self.redirect(request)
	  File "/Users/thijstriemstra/projects/twisted/twisted/web/", line 613, in redirect
	    return redirectTo(addSlash(request), request)
	  File "/Users/thijstriemstra/projects/twisted/twisted/web/", line 66, in addSlash
	    qindex = request.uri.find('?')
	builtins.TypeError: 'str' does not support the buffer interface

Change History (2)

comment:1 Changed 3 years ago by Adi Roiban

Resolution: duplicate
Status: newclosed

Looks like a duplicate of #8169

comment:2 Changed 3 years ago by Thijs Triemstra

Oops, thanks!

Note: See TracTickets for help on using tickets.