[Twisted-web] getChild in python3
Nathaniel Haggard
natester at gmail.com
Tue Nov 5 13:20:59 MST 2019
# This code doesn't call getChild in python3, but it does in python2
(python2 throws AttributeError, but python3 doesn't) with "curl
http://127.0.0.1:8803/bug/a" and Twisted==19.7.0 with python3.5.2:
from twisted.application import internet, service, strports
from twisted.web.resource import Resource
from twisted.web.server import Site
from twisted.internet import reactor
from twisted.python import log
from twisted.web.resource import Resource
class R(Resource):
allowedMethods=('GET',)
def getChild(self, name, request):
pass
r = Resource()
r.putChild('bug', R())
application = service.Application('web')
site = Site(r)
sc = service.IServiceCollection(application)
i = strports.service("tcp:8803", site)
i.setServiceParent(sc)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/twisted-web/attachments/20191105/5629d4c1/attachment.html>
More information about the Twisted-web
mailing list