You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PlatformIO Core.
If you’ve found a bug, please provide an information below.
Configuration
Operating system: Windows 10
PlatformIO Version (platformio --version): PlatformIO Core, version 6.1.16
Description of problem
Steps to Reproduce
Open PlatformIO CLI enabled PowerShell terminal
Try pio pkg list
Then try pio pkg list > file.log
Actual Results
Works.
Crashes.
PS D:\Projects\+embedded\YellowToyCar> pio pkg list > xd.log
UnicodeEncodeError: Traceback (most recent call last):
File "C:\Users\PsychoX\.platformio\penv\Lib\site-packages\platformio\__main__.py", line 103, in main
cli() # pylint: disable=no-value-for-parameter
^^^^^
File "C:\Users\PsychoX\.platformio\penv\Lib\site-packages\click\core.py", line 1157, in __call__
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\PsychoX\.platformio\penv\Lib\site-packages\click\core.py", line 1078, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "C:\Users\PsychoX\.platformio\penv\Lib\site-packages\platformio\cli.py", line 85, in invoke
return super().invoke(ctx)
^^^^^^^^^^^^^^^^^^^
File "C:\Users\PsychoX\.platformio\penv\Lib\site-packages\click\core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\PsychoX\.platformio\penv\Lib\site-packages\click\core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\PsychoX\.platformio\penv\Lib\site-packages\click\core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\PsychoX\.platformio\penv\Lib\site-packages\click\core.py", line 783, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\PsychoX\.platformio\penv\Lib\site-packages\platformio\package\commands\list.py", line 56, in package_list_cmd
list_project_packages(options)
File "C:\Users\PsychoX\.platformio\penv\Lib\site-packages\platformio\package\commands\list.py", line 179, in list_project_packages
_found = print_project_env_platform_packages(env, options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\PsychoX\.platformio\penv\Lib\site-packages\platformio\package\commands\list.py", line 205, in print_project_env_platform_packages
print_dependency_tree(
File "C:\Users\PsychoX\.platformio\penv\Lib\site-packages\platformio\package\commands\list.py", line 99, in print_dependency_tree
click.echo(
File "C:\Users\PsychoX\.platformio\penv\Lib\site-packages\platformio\__main__.py", line 89, in <lambda>
click.echo = lambda *args, **kwargs: _safe_echo(0, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\PsychoX\.platformio\penv\Lib\site-packages\platformio\__main__.py", line 83, in _safe_echo
click_echo_origin[origin](*args, **kwargs)
File "C:\Users\PsychoX\.platformio\penv\Lib\site-packages\click\utils.py", line 318, in echo
file.write(out) # type: ignore
^^^^^^^^^^^^^^^
File "C:\Users\PsychoX\.platformio\python3\Lib\encodings\cp1250.py", line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_table)[0]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
UnicodeEncodeError: 'charmap' codec can't encode characters in position 0-2: character maps to <undefined>
This error occurs even without a project (pio pkg list -g | more). If you replace utf-8 characters with something simple ("!--", "+--"), the error does not occur:
click.echo(message=None, file=None, nl=True, err=False, color=None)
Print a message and newline to stdout or a file. This should be used instead of print() because it provides better support for different data, files, and environments.
Compared to print(), this does the following:
Supports Unicode in the Windows console.
Supports colors and styles on Windows.
Changed in version 6.0: Support Unicode output on the Windows console. Click does not modify sys.stdout, so sys.stdout.write() and print() will still not support Unicode.
What kind of issue is this?
If you’ve found a bug, please provide an information below.
Configuration
Operating system: Windows 10
PlatformIO Version (
platformio --version
): PlatformIO Core, version 6.1.16Description of problem
Steps to Reproduce
pio pkg list
pio pkg list > file.log
Actual Results
file.log
:Expected Results
I just wanted to redirect the command output to the file, just save to file to ease reading hundreds of lines long output...
If problems with PlatformIO Build System:
The content of
platformio.ini
:(idk, if useful, but flexing ;) )
Source file to reproduce issue: N/A
Additional info
Any redirection causes similar problem, incl.
pio pkgs list | more
.The text was updated successfully, but these errors were encountered: