[Bug] Missing pythoncom.CoInitialize() in Flask request threads for COM initialization

Resolved 💬 2 comments Opened May 5, 2026 by ganfabo123-cmyk Closed May 8, 2026

Bug Description
继续分析 s o u ● 서버 로그를 보면 [plan-layout/com] one_col anchor=... 까지는 출력됐는데 그 다음이 없습니다. COM 호출 직전에 죽은 것입니다. 원인은 Flask 요청 스레드에서 pythoncom.CoInitialize()를 호출하지 않은 것입니다. 서버의 _refresh_ole_previews와 convert()는 직접 CoInitialize를 호출하는데, wps_com/insert_image.py의 _get_app은 이걸 빠뜨렸습니다. Flask는 멀티스레드로 동작하기 때문에 각 요청 스레드마다 COM을 별도 초기화해야 합니다. ● Update(wps_com\insert_image.py) ⎿ Added 2 lines 32 def _get_app(visible: bool = False): 33 try: 34 import win32com.client as wc 35 + import pythoncom 36 except ImportError: …
Note: Content was truncated.

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗