mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-30 10:07:14 +02:00
Fix "UnicodeEncodeError: 'ascii' codec can't encode characters" // Resolve #2644
This commit is contained in:
@ -35,7 +35,7 @@ class EnvironmentProcessor(object):
|
|||||||
self, cmd_ctx, name, config, targets, upload_port, silent,
|
self, cmd_ctx, name, config, targets, upload_port, silent,
|
||||||
verbose):
|
verbose):
|
||||||
self.cmd_ctx = cmd_ctx
|
self.cmd_ctx = cmd_ctx
|
||||||
self.name = str(name)
|
self.name = name
|
||||||
self.config = config
|
self.config = config
|
||||||
self.targets = [str(t) for t in targets]
|
self.targets = [str(t) for t in targets]
|
||||||
self.upload_port = upload_port
|
self.upload_port = upload_port
|
||||||
|
@ -47,7 +47,9 @@ if PY2:
|
|||||||
def hashlib_encode_data(data):
|
def hashlib_encode_data(data):
|
||||||
if is_bytes(data):
|
if is_bytes(data):
|
||||||
return 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)
|
data = str(data)
|
||||||
return data
|
return data
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user