PlatformIO Community

Unable to compile after vscode update

Unable to run “pio run” after vscode update to latest version.

Executing task in folder TempAndTimerControl: C:\Users<user>.platformio\penv\Scripts\platformio.exe run <

Traceback (most recent call last):
File “c:\users<user>.platformio\penv\lib\site-packages\platformio_main_.py”, line 109, in main
cli() # pylint: disable=no-value-for-parameter
File “c:\users<user>.platformio\penv\lib\site-packages\click\core.py”, line 829, in call
return self.main(*args, **kwargs)
File “c:\users<user>.platformio\penv\lib\site-packages\click\core.py”, line 782, in main
rv = self.invoke(ctx)
File “c:\users<user>.platformio\penv\lib\site-packages\platformio\commands_init_.py”, line 44, in invoke
return super(PlatformioCLI, self).invoke(ctx)
File “c:\users<user>.platformio\penv\lib\site-packages\click\core.py”, line 1256, in invoke
Command.invoke(self, ctx)
File “c:\users<user>.platformio\penv\lib\site-packages\click\core.py”, line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “c:\users<user>.platformio\penv\lib\site-packages\click\core.py”, line 610, in invoke
return callback(*args, **kwargs)
File “c:\users<user>.platformio\penv\lib\site-packages\click\decorators.py”, line 21, in new_func
return f(get_current_context(), *args, **kwargs)
File “c:\users<user>.platformio\penv\lib\site-packages\platformio_main_.py”, line 63, in cli
maintenance.on_platformio_start(ctx, force, caller)
File “c:\users<user>.platformio\penv\lib\site-packages\platformio\maintenance.py”, line 44, in on_platformio_start
telemetry.on_command()
File “c:\users<user>.platformio\penv\lib\site-packages\platformio\telemetry.py”, line 292, in on_command
resend_backuped_reports()
File “c:\users<user>.platformio\penv\lib\site-packages\platformio\telemetry.py”, line 443, in resend_backuped_reports
tm = app.get_state_item(“telemetry”, {})
File “c:\users<user>.platformio\penv\lib\site-packages\platformio\app.py”, line 187, in get_state_item
with State() as state:
File “c:\users<user>.platformio\penv\lib\site-packages\platformio\app.py”, line 90, in init
self.path = join(get_project_core_dir(), “appstate.json”)
File “c:\users<user>.platformio\penv\lib\site-packages\platformio\project\helpers.py”, line 51, in get_project_core_dir
join(get_project_dir(), “platformio.ini”)
File “c:\users<user>.platformio\penv\lib\site-packages\platformio\project\config.py”, line 447, in get_instance
instance = {“mtime”: mtime, “config”: ProjectConfig(path)}
File “c:\users<user>.platformio\penv\lib\site-packages\platformio\project\config.py”, line 102, in init
self.read(path, parse_extra)
File “c:\users<user>.platformio\penv\lib\site-packages\platformio\project\config.py”, line 114, in read
self._parser.read(path)
File “C:\Users<user>.platformio\python3\lib\configparser.py”, line 696, in read
self._read(fp, filename)
File “C:\Users<user>.platformio\python3\lib\configparser.py”, line 1014, in _read
for lineno, line in enumerate(fp, start=1):
File “C:\Users<user>.platformio\python3\lib\encodings\cp1252.py”, line 23, in decode
return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: ‘charmap’ codec can’t decode byte 0x9d in position 2046: character maps to

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “C:\Users<user>.platformio\python3\lib\runpy.py”, line 193, in run_module_as_main
main”, mod_spec)
File “C:\Users<user>.platformio\python3\lib\runpy.py”, line 85, in run_code
exec(code, run_globals)
File "C:\Users<user>.platformio\penv\Scripts\platformio.exe_main
.py", line 7, in
File "c:\users<user>.platformio\penv\lib\site-packages\platformio_main
.py", line 115, in main
maintenance.on_platformio_exception(e)
File “c:\users<user>.platformio\penv\lib\site-packages\platformio\maintenance.py”, line 71, in on_platformio_exception
telemetry.on_exception(e)
File “c:\users<user>.platformio\penv\lib\site-packages\platformio\telemetry.py”, line 322, in on_exception
send_exception(description, is_fatal)
File “c:\users<user>.platformio\penv\lib\site-packages\platformio\telemetry.py”, line 394, in send_exception
mp = MeasurementProtocol()
File “c:\users<user>.platformio\penv\lib\site-packages\platformio\telemetry.py”, line 74, in init
self[“cid”] = app.get_cid()
File “c:\users<user>.platformio\penv\lib\site-packages\platformio\app.py”, line 252, in get_cid
cid = get_state_item(“cid”)
File “c:\users<user>.platformio\penv\lib\site-packages\platformio\app.py”, line 187, in get_state_item
with State() as state:
File “c:\users<user>.platformio\penv\lib\site-packages\platformio\app.py”, line 90, in init
self.path = join(get_project_core_dir(), “appstate.json”)
File “c:\users<user>.platformio\penv\lib\site-packages\platformio\project\helpers.py”, line 51, in get_project_core_dir
join(get_project_dir(), “platformio.ini”)
File “c:\users<user>.platformio\penv\lib\site-packages\platformio\project\config.py”, line 447, in get_instance
instance = {“mtime”: mtime, “config”: ProjectConfig(path)}
File “c:\users<user>.platformio\penv\lib\site-packages\platformio\project\config.py”, line 102, in init
self.read(path, parse_extra)
File “c:\users<user>.platformio\penv\lib\site-packages\platformio\project\config.py”, line 114, in read
self._parser.read(path)
File “C:\Users<user>.platformio\python3\lib\configparser.py”, line 696, in read
self._read(fp, filename)
File “C:\Users<user>.platformio\python3\lib\configparser.py”, line 1014, in _read
for lineno, line in enumerate(fp, start=1):
File “C:\Users<user>.platformio\python3\lib\encodings\cp1252.py”, line 23, in decode
return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: ‘charmap’ codec can’t decode byte 0x9d in position 2046: character maps to
The terminal process “C:\Users<user>.platformio\penv\Scripts\platformio.exe ‘run’” terminated with exit code: 1.

Terminal will be reused by tasks, press any key to close it.

Found a workaround:
In File “C:\Users<user>.platformio\python3\lib\configparser.py”, line 696, in read
self._read(fp, filename)

replaced the following line
with open(filename, encoding=encoding) as fp:
with
with open(filename, encoding=‘utf-8’) as fp:

now i am able to compile. But i am not sure if its proper fix