Merge ~cjwatson/launchpad:py3-decoratedresultset-len into launchpad:master
Proposed by
Colin Watson
Status: | Merged |
---|---|
Approved by: | Colin Watson |
Approved revision: | c1c601778ff02dd26e127551d2a4dd047affef5c |
Merge reported by: | Otto Co-Pilot |
Merged at revision: | not available |
Proposed branch: | ~cjwatson/launchpad:py3-decoratedresultset-len |
Merge into: | launchpad:master |
Diff against target: |
13 lines (+1/-1) 1 file modified
lib/lp/services/database/configure.zcml (+1/-1) |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Ioana Lasc (community) | Approve | ||
Review via email: mp+392371@code.launchpad.net |
Commit message
Allow DecoratedResult
Description of the change
On Python 3, list() calls len() internally to preallocate the correct amount of space if possible. If __len__ is unimplemented, then it falls back to guessing, but ForbiddenAttribute confuses it and results in failing to create the list. Allowing __len__ through the security proxy, even though it's unimplemented, avoids this.
To post a comment you must log in.