Skip to content

mkbuildoptglobals.py UnicodeEncodeError #9013

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
alyaparan opened this issue Nov 1, 2023 · 4 comments
Open

mkbuildoptglobals.py UnicodeEncodeError #9013

alyaparan opened this issue Nov 1, 2023 · 4 comments

Comments

@alyaparan
Copy link

FQBN: esp8266:esp8266:generic
Using board 'generic' from platform in folder: C:\Users\alikp\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.1.2
Using core 'esp8266' from platform in folder: C:\Users\alikp\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.1.2

"C:\Users\alikp\AppData\Local\Arduino15\packages\esp8266\tools\python3\3.7.2-post1/python3" -I "C:\Users\alikp\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.1.2/tools/mkbuildoptglobals.py" "C:\Program Files\Arduino IDE\resources\app\lib\backend\resources" 10607 "C:\Users\alikp\AppData\Local\Temp\arduino\sketches\09D9037E17A77D643A195D118E3D3DA0" "C:\Users\alikp\AppData\Local\Temp\arduino\sketches\09D9037E17A77D643A195D118E3D3DA0/core/build.opt" "C:\Users\alikp\OneDrive\Документы\duino-coin-master\ESP8266_Code/ESP8266_Code.ino.globals.h" "C:\Users\alikp\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.1.2\cores\esp8266/CommonHFile.h"
default_encoding: cp1252
Assume aggressive 'core.a' caching enabled.
Note: optional global include file 'C:\Users\alikp\OneDrive\u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u044b\duino-coin-master\ESP8266_Code\ESP8266_Code.ino.globals.h' does not exist.
Read more at https://arduino-esp8266.readthedocs.io/en/latest/faq/a06-global-build-options.html

*** Traceback (most recent call last):
File "C:\Users\alikp\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.1.2/tools/mkbuildoptglobals.py", line 824, in
rc = main()
File "C:\Users\alikp\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.1.2/tools/mkbuildoptglobals.py", line 819, in main
handle_error(0) # commit print buffer
File "C:\Users\alikp\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.1.2/tools/mkbuildoptglobals.py", line 274, in handle_error
print(msg_print_buf, file=fd, end='', flush=True)
File "D:\obj\Windows-Release\37win32_Release\msi_python\zip_win32\cp1252.py", line 19, in encode
UnicodeEncodeError: 'charmap' codec can't encode characters in position 137-145: character maps to

exit status 1

Compilation error: exit status 1

@mcspr mcspr changed the title FQBN: esp8266:esp8266:generic mkbuildoptglobals.py UnicodeEncodeError Nov 1, 2023
@d-a-v
Copy link
Collaborator

d-a-v commented Nov 4, 2023

If you're able to locate the file mkbuildoptglobals.py, can you try and change

default_encoding = get_encoding()

to

    default_encoding = 'utf-8'

and report if this fixes your issue ?

@mcspr
Copy link
Collaborator

mcspr commented Nov 4, 2023

Note that encoding needs to happen for sys.stdout, above only sets it for file I/O. Line prints full path, basename(fpath) would help (or just removing the line(s) mentioning user path completely)

print_msg("Note: optional global include file '" + source_globals_h_fqfn + "' does not exist.")

Nuclear opt is to set -X utf8, but I still don't think it does the right thing here? Would work-around the above, but pretty missable otherwise

@alyaparan
Copy link
Author

If you're able to locate the file mkbuildoptglobals.py, can you try and change

default_encoding = get_encoding()

to

    default_encoding = 'utf-8'

and report if this fixes your issue ?

It's not worked, same issue with utf-8

@mhightower83
Copy link
Contributor

To get more insight, try adding this line to your platform.local.txt file and report the build results.

mkbuildoptglobals.extra_flags=--debug

Which version of the Arduino IDE are you using?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants