mod_wsgi icon indicating copy to clipboard operation
mod_wsgi copied to clipboard

`mod_wsgi.Log.write()` doesn’t accept memoryview

Open manueljacob opened this issue 1 year ago • 1 comments

When having sys.stderr.buffer.write(memoryview(b'test\n')) in a WSGI script, it fails with “TypeError: write() argument 1 must be read-only bytes-like object, not memoryview”.

On mod_wsgi, sys.stderr.buffer is a mod_wsgi.Log object. Its write() implementation accepts only read-only bytes-like objects, but it could be changed to accept all bytes-like objects. (On a related note, the method currently accepts unicode as well, which it probably shouldn’t.)

manueljacob avatar Nov 01 '23 10:11 manueljacob