filter_file: fix various bugs (#48038)
* `f.tell` on a `TextIOWrapper` does not return the offset in bytes, but an opaque integer that can only be used for `f.seek` on the same object. Spack assumes it's a byte offset. * Do not open in a locale dependent way, but assume utf-8 (and allow users to override that) * Use tempfile to generate a backup/temporary file in a safe way * Comparison between None and str is valid and on purpose.
Please register or sign in to comment