zopefoundation / zope.publisher

Map requests from HTTP/WebDAV clients, web browsers, XML-RPC and FTP clients onto Python objects
Other
3 stars 13 forks source link

`BaseRequest` needs to define `__bool__` for Python 3 #18

Closed jamadden closed 7 years ago

jamadden commented 7 years ago

It defines __nonzero__ to always be True for Python 2, but it doesn't define __bool__ for Python 3. So it falls back to __len__ and you get different behaviour (requests seem false when they shouldn't be).

Found testing zc.resourcelibrary with Python 3. https://github.com/zopefoundation/zc.resourcelibrary/pull/2