Fix "UnicodeEncodeError: 'ascii' codec can't encode characters" // Resolve #2644

This commit is contained in:
Ivan Kravets
2019-06-10 19:44:18 +03:00
parent 97acf23a6d
commit 9de7297d38
2 changed files with 4 additions and 2 deletions

View File

@ -35,7 +35,7 @@ class EnvironmentProcessor(object):
self, cmd_ctx, name, config, targets, upload_port, silent,
verbose):
self.cmd_ctx = cmd_ctx
self.name = str(name)
self.name = name
self.config = config
self.targets = [str(t) for t in targets]
self.upload_port = upload_port

View File

@ -47,7 +47,9 @@ if PY2:
def hashlib_encode_data(data):
if is_bytes(data):
return data
if not isinstance(data, string_types):
if isinstance(data, unicode):
data = data.encode(get_filesystem_encoding())
elif not isinstance(data, string_types):
data = str(data)
return data