Opened at 2016-04-07T01:04:59Z
Closed at 2020-01-20T16:45:29Z
#2771 closed defect (fixed)
upcoming deprecation in webish.py
Reported by: | warner | Owned by: | GitHub <noreply@…> |
---|---|---|---|
Priority: | normal | Milestone: | undecided |
Component: | code-frontend-web | Version: | 1.11.0 |
Keywords: | nevow twisted review | Cc: | |
Launchpad Bug: |
Description
Our shiny new deprecations builder is running Tahoe tests against git trunk for both Twisted and Foolscap. It's yielded our first early warning signs:
.../allmydata/webish.py:44: DeprecationWarning: twisted.web.http.Request.channel was deprecated in Twisted 16.2.0. Call directly into the Request object instead. .../allmydata/webish.py:45: DeprecationWarning: twisted.web.http.Request.channel was deprecated in Twisted 16.2.0. Call directly into the Request object instead. .../nevow/appserver.py:229: DeprecationWarning: twisted.web.http.Request.channel was deprecated in Twisted 16.2.0. Call directly into the Request object instead.
It looks like our cut/paste/override copy of twisted.web.http.Request.requestReceived is out of date, and is using things that Twisted will be deprecating in the next release (the current release, 16.1.0, doesn't produce complaints).
Nominally we could just make our local requestReceived method look more like Twisted's current copy (in this case, changing self.client = self.channel.transport.getPeer() into = self._channel.getPeer()), but it might be good to rethink this, and find a way to get rid of our custom subclass. Especially because then we'd be using a clearly-marked-as-private attribute.
This might also tie into removing Nevow (#1963).
Change History (4)
comment:1 Changed at 2016-05-05T02:08:18Z by warner
comment:2 Changed at 2020-01-17T16:42:47Z by exarkun
As of Twisted 18.4.0 client and host attributes are set by Request.__init__ so these two lines can simply be deleted - if the Twisted dependency is bumped up to 18.4.0 which is nearly two years old at this point (and will almost certainly be more than two years old by the time this change is released) and thus seems reasonable.
comment:3 Changed at 2020-01-17T16:45:49Z by exarkun
- Keywords review added
comment:4 Changed at 2020-01-20T16:45:29Z by GitHub <noreply@…>
- Owner set to GitHub <noreply@…>
- Resolution set to fixed
- Status changed from new to closed
In 3de23ddf/trunk:
This might have been reverted in current Twisted trunk.. at least the buildbot isn't complaining anymore. I know they had some regressions with .channel that affected Autobahn, so they're currently rethinking how they arrange the Request object.
We should still fix our code to stop poking around inside requestReceived, of course.