SIGN IN SIGN UP

Fix UnicodeEncodeError writing kernel log on Windows (#1163)

`kernels_output` writes the kernel log with `open(outfile, "w")` and no
`encoding`
argument, so Python uses the locale default. On Windows that's cp1252,
which can't
encode the block characters pip emits in its progress bars:

`UnicodeEncodeError: 'charmap' codec can't encode character '\u2588' in
position 0: character maps to <undefined>`

The data files just above it open in binary mode and are unaffected, so
the download
completes and then the command dies on the last write.

I hit this pulling notebook outputs while working on an NLP dataset
project.

**Fix:** pass `encoding="utf-8"`. No `errors=` needed — UTF-8 encodes
any valid `str`.

**Reproduction** on Linux, forcing the encoding Windows uses by default:
`python3 -c "open('t.log','w',encoding='cp1252').write('\u2588')"`
A
Abhimanyu Prasad committed
816cf9913e87dbd65e202a60ed53fcfec4da5c51
Parent: bdcc1aa
Committed by GitHub <noreply@github.com> on 8/5/2026, 9:54:08 PM