question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[win64] UnicodeEncodeError when printing error message

See original GitHub issue

Over in https://github.com/conda-forge/torchsde-feedstock/pull/2 I was trying to use the new build_with_mambabuild capability to debug dependency issues.

Unfortunately when printing the error message I’m hitting a UnicodeEncodeError

Preparing transaction: ...working... done
Verifying transaction: ...working... done
Executing transaction: ...working... done
D:/bld/win-64             
D:/bld/noarch             
Transaction

  Prefix: C:\Miniconda

  Updating specs:

   - vs2017_win-64==19.16.27038=h2e3bad8_2
   - vswhere==2.8.4=h57928b3_0


Traceback (most recent call last):
  File "C:\Miniconda\Scripts\conda-mambabuild-script.py", line 10, in <module>
    sys.exit(main())
  File "C:\Miniconda\lib\site-packages\boa\cli\mambabuild.py", line 140, in main
    call_conda_build(action, config)
  File "C:\Miniconda\lib\site-packages\boa\cli\mambabuild.py", line 125, in call_conda_build
    **kwargs,
  File "C:\Miniconda\lib\site-packages\conda_build\api.py", line 195, in build
    variants=variants
  File "C:\Miniconda\lib\site-packages\conda_build\build.py", line 3073, in build_tree
    notest=notest,
  File "C:\Miniconda\lib\site-packages\conda_build\build.py", line 2108, in build
    create_build_envs(top_level_pkg, notest)
  File "C:\Miniconda\lib\site-packages\conda_build\build.py", line 1976, in create_build_envs
    channel_urls=tuple(m.config.channel_urls))
  File "C:\Miniconda\lib\site-packages\boa\cli\mambabuild.py", line 68, in mamba_get_install_actions
    solution = solver.solve_for_action(_specs, prefix)
  File "C:\Miniconda\lib\site-packages\boa\core\solver.py", line 193, in solve_for_action
    t = self.solve(specs)
  File "C:\Miniconda\lib\site-packages\boa\core\solver.py", line 185, in solve
    print(error_string)
  File "C:\Miniconda\lib\site-packages\colorama\ansitowin32.py", line 41, in write
    self.__convertor.write(text)
  File "C:\Miniconda\lib\site-packages\colorama\ansitowin32.py", line 162, in write
    self.write_and_convert(text)
  File "C:\Miniconda\lib\site-packages\colorama\ansitowin32.py", line 190, in write_and_convert
    self.write_plain_text(text, cursor, len(text))
  File "C:\Miniconda\lib\site-packages\colorama\ansitowin32.py", line 195, in write_plain_text
    self.wrapped.write(text[start:end])
  File "C:\Miniconda\lib\encodings\cp1252.py", line 19, in encode
    return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\u21df' in position 313: character maps to <undefined>
  Package            Version  Build       Channel                  Size
-------------------------------------------------------------------------
  Install:
-------------------------------------------------------------------------

  vs2017_win-64  19.16.27038  h2e3bad8_2  conda-forge/win-64     Cached
  vswhere              2.8.4  h57928b3_0  conda-forge/win-64     236 KB

  Summary:

  Install: 2 packages

  Total download: 236 KB

-------------------------------------------------------------------------

D:/bld/win-64             
D:/bld/noarch             
##[error]Cmd.exe exited with code '1'.

https://dev.azure.com/conda-forge/feedstock-builds/_build/results?buildId=282278&view=logs&j=00f5923e-fdef-5026-5091-0d5a0b3d5a2c&t=3cc4a9ed-60e1-5810-6eb3-5f9cd4a26dba

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
wolfvcommented, Feb 25, 2021

It turns out there is actually a weird character there 🤦

This one: … sorry for that. I will release boa today 😃

0reactions
dhirschfeldcommented, Feb 25, 2021

No rush - no great urgency on my part.

Read more comments on GitHub >

github_iconTop Results From Across the Web

UnicodeEncodeError on Windows when there are Unicode ...
I have come across an error when I try to print the help message for my app (--help) on Windows (using bash, cmd,...
Read more >
Python, Unicode, and the Windows console - Stack Overflow
The error means that Unicode characters that you are trying to print can't be represented using the current ( chcp ) console character...
Read more >
Issue 1602: windows console doesn't print or input Unicode
msg58487 ‑ (view) Author: Mark Summerfield (mark) * Date: 2007‑12‑12 09:56 msg58621 ‑ (view) Author: Mark Summerfield (mark) * Date: 2007‑12‑14 11:31 msg58651 ‑ (view)...
Read more >
UnicodeEncodeError: 'charmap' codec can't encode character
Answer: The problem is that your Python code is expecting the returned string to be in the cp437 byte representation. “cp437” is code...
Read more >
FormatMessage function (winbase.h) - Win32 apps
If the length of the formatted message exceeds 128K bytes, then FormatMessage will not automatically fail with an error of ERROR_MORE_DATA.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found