fixed bug: empty buf for OSError -- must be bytes (not str)