ipython / ipython

Official repository for IPython itself. Other repos in the IPython organization contain things like the website, documentation builds, etc.

Home Page:https://ipython.readthedocs.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

IPython crashes on windows server with locale.setlocale

mhechthz opened this issue · comments

Working with Spyder or directly IPython on Windows Server 2019 we face the problem, that with Python 3.11.8 as well as Python 3.12.3 on this code the IPython environment crashes. Code:

import time
import locale

locale.setlocale(locale.LC_ALL,"de_DE.UTF-8")

print(time.localtime())

Message in IPython spyder (varies, last is restart kernel):

Windows fatal exception: code 0xc0000374

Main thread:
Current thread 0x00025920 (most recent call first):
  File "c:\users\di29394\.spyder-py3\temp.py", line 13 in <module>
  File "C:\Python\Python312\Lib\site-packages\spyder_kernels\py3compat.py", line 356 in compat_exec
  File "C:\Python\Python312\Lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 473 in exec_code
  File "C:\Python\Python312\Lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 615 in _exec_file
  File "C:\Python\Python312\Lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 528 in runfile
  File "C:\Users\di29394\AppData\Local\Temp\20\ipykernel_127360\4017716904.py", line 1 in <module>

Kernel wird neu gestartet...

On commandline IPython exits with no message. The crashing command is the access to time.localtime().

It seems that it works with locale.setlocale(locale.LC_ALL,"deu_deu"). Setting e.g. locale.setlocale(locale.LC_ALL,"xy_xy") crashed again, so it obviously crashes on wrong or non-existing locale.