Trnasform file name to bytes before opening it to avoid unicode errors if python tries to encode it implicitly

This commit is contained in:
Toshio Kuratomi 2016-04-19 08:32:08 -07:00
parent 3014f78bb9
commit e386a51cf8

View file

@ -329,7 +329,7 @@ class DataLoader():
real_path = self.path_dwim(file_path)
try:
with open(real_path, 'rb') as f:
with open(to_bytes(real_path), 'rb') as f:
data = f.read()
if self._vault.is_encrypted(data):
# if the file is encrypted and no password was specified,