diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2024-11-17 20:20:48 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2024-11-17 20:20:58 +1300 |
commit | 2cc2258b5b1e9f2c4c04d04355c79e965421a35d (patch) | |
tree | c8e7bc1bf5fbb78937b18fe5db914e2b8c867478 | |
parent | Handle edge case: empty file after edit (diff) | |
download | vixf-2cc2258b5b1e9f2c4c04d04355c79e965421a35d.tar.gz vixf-2cc2258b5b1e9f2c4c04d04355c79e965421a35d.zip |
Move encoding fetch inline
We're explicit about using the locale encoding to appease pylint, which
doesn't like its being implicit. This is what it does by default
anyway.
-rw-r--r-- | vixf.py3 | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -73,8 +73,11 @@ def main(environ): ] subprocess.run(command, check=True) - encoding = locale.getpreferredencoding() - with open(tf.name, mode='r', encoding=encoding) as tfr: + with open( + tf.name, + mode='r', + encoding=locale.getpreferredencoding(), + ) as tfr: content_after = tfr.read() # If any data in the file after edit, copy it to the clipboard |