diff --git a/pyinfra/api/util.py b/pyinfra/api/util.py
index <HASH>..<HASH> 100644
--- a/pyinfra/api/util.py
+++ b/pyinfra/api/util.py
@@ -189,7 +189,7 @@ def get_file_sha1(filename):
 
     # Otherwise, assume a filename and open it up
     else:
-        file_io = open(filename)
+        file_io = open(filename, 'rb')
 
     # Ensure we're at the start of the file
     file_io.seek(0)
@@ -198,7 +198,7 @@ def get_file_sha1(filename):
     hasher = sha1()
 
     while len(buff) > 0:
-        hasher.update(buff.encode())
+        hasher.update(buff)
         buff = file_io.read(BLOCKSIZE)
 
     return hasher.hexdigest()
diff --git a/pyinfra/modules/files.py b/pyinfra/modules/files.py
index <HASH>..<HASH> 100644
--- a/pyinfra/modules/files.py
+++ b/pyinfra/modules/files.py
@@ -279,7 +279,7 @@ def put(
         if add_deploy_dir and state.deploy_dir:
             local_filename = path.join(state.deploy_dir, local_filename)
 
-        local_file = open(local_filename)
+        local_file = open(local_filename, 'rb')
 
     mode = ensure_mode_int(mode)
     remote_file = host.fact.file(remote_filename)
Basic binary file support: needs tests and further verification.