#1304·yapf

[错误]: 使用 logging.getLogger 中的字典时出现 ParseError

作者: MikeSullivan7创建于 2026年4月1日更新于 2026年6月12日

When using a dict directly inside logging.getLogger.info(), it leads to a yapf_third_party._ylib2to3.pgen2.parse.ParseError

This bug is reproducible with the following basic code and the most recent version of yapf 0.43.0:

from logging import getLogger
LOG = getLogger(__name__)
roi_dict = {"ROI": "roi_1"}
LOG.info(f"ROI loaded: name={roi_dict['ROI']}")

This leads to the following error: