From 78b8b52a86748550638d21704eb5a11ab4d67b96 Mon Sep 17 00:00:00 2001 From: Hyungi Ahn Date: Fri, 15 May 2026 16:39:47 +0900 Subject: [PATCH] =?UTF-8?q?fix(news):=20backfill=20script=20sys.path=20?= =?UTF-8?q?=EC=BB=A8=ED=85=8C=EC=9D=B4=EB=84=88=20=ED=98=B8=ED=99=98=20(pa?= =?UTF-8?q?rent.parent=20/=20'app'=20=EB=98=90=EB=8A=94=20parent.parent)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.7 (1M context) --- scripts/news_chunk_country_backfill.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/news_chunk_country_backfill.py b/scripts/news_chunk_country_backfill.py index 39b8533..604a580 100644 --- a/scripts/news_chunk_country_backfill.py +++ b/scripts/news_chunk_country_backfill.py @@ -32,7 +32,11 @@ import sys from datetime import datetime, timezone from pathlib import Path -sys.path.insert(0, str(Path(__file__).resolve().parent.parent / "app")) +_repo_root = Path(__file__).resolve().parent.parent +for _candidate in (_repo_root / "app", _repo_root): + if (_candidate / "core").is_dir() and str(_candidate) not in sys.path: + sys.path.insert(0, str(_candidate)) + break from sqlalchemy import text from sqlalchemy.ext.asyncio import AsyncSession