[mozlog] LoggingWrapper doesn't have a buffer attribute
Categories
(Testing :: Mozbase, defect)
Tracking
(firefox80 fixed)
Tracking | Status | |
---|---|---|
firefox80 | --- | fixed |
People
(Reporter: jgraham, Assigned: jgraham)
Details
Attachments
(1 file)
When running under Py3, mozprocess tries to access sys.stdout.buffer
to get the handle of something that accepts bytes. The problem is that if stdout is wrapped with some custom file-like it might not have that attribute. mozlog has a LoggingWrapper
which is a BytesIO that can wrap stdout. This doesn't have a buffer attribute (and technically isn't a good wrapper for stdio since it derives from BytesIO
, but in practice write
handles bytes and text).
Assignee | ||
Comment 1•4 years ago
|
||
stdout in Python 3 has a buffer
attribute that gives access to the
underlying bytestream. Code trying to access this will fail with
LoggingWrapper, because the property isn't defined. In practice the
write()
method of LoggingWrapper handles both bytes and text, so
it's sufficient to just return the object itself.
Updated•4 years ago
|
Pushed by james@hoppipolla.co.uk: https://hg.mozilla.org/integration/autoland/rev/db80fd693933 Give mozlog's LoggingWrapper a buffer attribute, r=ahal
Comment 3•4 years ago
|
||
bugherder |
Description
•