statprof: ensure files with binary I/O are opened in binary mode...
statprof: ensure files with binary I/O are opened in binary mode
These appear to have been existing bugs, so maybe this should go on stable.
OTOH, PyCharm is flagging 8 other things in this file, claiming symbols and/or
imports don't exist. I haven't dug into that, but suspect that this module
isn't used much, based on the bugs fixed here and no previous complaints.
These were previously hidden by the `pycompat.open()` import, because that is
typed as returning `Any` instead of `BinaryIO`. (I didn't look up the reason
for that, but do recall there was one.)