debugantivirusrunning: use bytes when opening a vfs file
authorMatt Harbison <matt_harbison@yahoo.com>
Fri, 04 Oct 2024 23:23:24 -0400
changeset 51939 8d9767bf4adb
parent 51938 fa7059f031a9
child 51940 54d9f496f07a
debugantivirusrunning: use bytes when opening a vfs file I noticed this when searching for "base85" to see if anything else in the previous commit needed to be annotated. This was added in 87047efbc6a6, after the mass byteification in 687b865b95ad.
mercurial/debugcommands.py
--- a/mercurial/debugcommands.py	Fri Oct 04 23:21:41 2024 -0400
+++ b/mercurial/debugcommands.py	Fri Oct 04 23:23:24 2024 -0400
@@ -143,7 +143,7 @@
 @command(b'debugantivirusrunning', [])
 def debugantivirusrunning(ui, repo):
     """attempt to trigger an antivirus scanner to see if one is active"""
-    with repo.cachevfs.open('eicar-test-file.com', b'wb') as f:
+    with repo.cachevfs.open(b'eicar-test-file.com', b'wb') as f:
         f.write(
             util.b85decode(
                 # This is a base85-armored version of the EICAR test file. See
@@ -154,7 +154,7 @@
         )
     # Give an AV engine time to scan the file.
     time.sleep(2)
-    util.unlink(repo.cachevfs.join('eicar-test-file.com'))
+    util.unlink(repo.cachevfs.join(b'eicar-test-file.com'))
 
 
 @command(b'debugapplystreamclonebundle', [], b'FILE')