Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding

As I detailed on the #136459 issue, I’m running the Home Assistant official Docker image and I cant upgrade it to any 2025 version:

s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
services-up: info: copying legacy longrun home-assistant (no readiness notification)
Python path configuration:
  PYTHONHOME = (not set)
  PYTHONPATH = (not set)
  program name = 'python3'
  isolated = 0
  environment = 1
  user site = 1
  safe_path = 0
  import site = 1
  is in build tree = 0
  stdlib dir = '/usr/local/lib/python3.13'
  sys.path[0] = (not set)
  sys._base_executable = '/usr/local/bin/python3'
  sys.base_prefix = '/usr/local'
  sys.base_exec_prefix = '/usr/local'
  sys.platlibdir = 'lib'
  sys.executable = '/usr/local/bin/python3'
  sys.prefix = '/usr/local'
  sys.exec_prefix = '/usr/local'
  sys.path = [
    '/usr/local/lib/python313.zip',
    '/usr/local/lib/python3.13',
    '/usr/local/lib/python3.13/lib-dynload',
  ]
Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
Python runtime state: core initialized
LookupError: no codec search functions registered: can't find encoding

Current thread 0x00007fff25022f30 (most recent call first):
  <no Python frame>
[15:49:59] INFO: Home Assistant Core finish process exit code 1
[15:49:59] INFO: Home Assistant Core service shutdown
s6-rc: info: service legacy-services successfully started
s6-rc: info: service legacy-services: stopping
[15:50:00] INFO: Home Assistant Core finish process exit code 256
[15:50:00] INFO: Home Assistant Core finish process received signal 15
s6-rc: info: service legacy-services successfully stopped
s6-rc: info: service legacy-cont-init: stopping
s6-rc: info: service legacy-cont-init successfully stopped
s6-rc: info: service fix-attrs: stopping
s6-rc: info: service fix-attrs successfully stopped
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped

The error persists starting with a new installation. Does anyone knows how to debug the problem or at least how to get more details to provide to the developers?.

Thanks!