Active code bage on ltsc2019

Hello,

Sorry if I post in wrong topic :smiley:

I use a python script in a windows container based ltsc2019 image and it returns “LookupError: unknown encoding: cp65001”

I observed that chcp command returns 0 which means some issue regarding encoding code.

I set PYTHONIOENCODING=UTF-8 but it does not help.

I tried an old windows image (ltsc2016) and here everything is fine but I cannot use git commands because OpenSSH is not present on this image.

I tried to use a new image (ltsc2022) and everything is fine but the container is not compatible with OS build from host.

Do you have an idea how can I solve this issue on ltsc2019 or do you know what other image can I use to be compatible with OS build 19044 ?

Thank you!

I searched for the error message. Have you found this which recommends instaling the “win-unicode-console” python package?

It was about Python 2.7 and I assume you already have Python 3.x, bt the solution could be the same

Windows containers support two types of isolations. “process” and “hyperv”. The OS build constraing should be a problem only with process isolation as far as I know. I heard Microsoft started to support different builds with process isolation too, but if you want to be sure it works, you should try the hyperv isolation.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.