Dec-17-2022, 09:00 PM
(Dec-17-2022, 06:47 PM)Skaperen Wrote: what cases where it may not have a mode attribute?When the (pseudo) file object was not opened by the function open(), for example
>>> import io >>> f = io.StringIO() >>> f.mode Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: '_io.StringIO' object has no attribute 'mode'