diff --git a/lib/ansible/modules/network/nxos/nxos_file_copy.py b/lib/ansible/modules/network/nxos/nxos_file_copy.py index 655f3cb6cf..a0a9fc2175 100644 --- a/lib/ansible/modules/network/nxos/nxos_file_copy.py +++ b/lib/ansible/modules/network/nxos/nxos_file_copy.py @@ -191,7 +191,7 @@ def md5sum_check(module, dst, file_system): local_file = module.params['local_file'] try: - with open(local_file, 'r') as f: + with open(local_file, 'rb') as f: filecontent = f.read() except (OSError, IOError) as exc: module.fail_json(msg="Error reading the file: %s" % to_text(exc))