Crash on triple quoted string with line continuation
还没有人认领这个 Issue。
评估
调研方向
使用所示的 demo.py 输入重现崩溃,然后检查 pycodestyle.py 中的 continued_indentation,回溯信息指出失败的列表赋值位于此处。当 pycodestyle 不再因这个包含续行的三引号字符串而崩溃,并且该回归问题已由项目测试覆盖(如适用)时,工作即完成。
由索引模型根据 Issue 内容生成。
描述
Given the file:
foo = \
"""bar
"""
pycodestyle 2.3.1 crashes:
$ pycodestyle demo.py
Traceback (most recent call last):
File "/users/is/whughes/pyenvs/research3/bin/pycodestyle", line 11, in <module>
sys.exit(_main())
File "/users/is/whughes/pyenvs/research3/lib/python2.7/site-packages/pycodestyle.py", line 2309, in _main
report = style_guide.check_files()
File "/users/is/whughes/pyenvs/research3/lib/python2.7/site-packages/pycodestyle.py", line 2010, in check_files
runner(path)
File "/users/is/whughes/pyenvs/research3/lib/python2.7/site-packages/pycodestyle.py", line 2022, in input_file
return fchecker.check_all(expected=expected, line_offset=line_offset)
File "/users/is/whughes/pyenvs/research3/lib/python2.7/site-packages/pycodestyle.py", line 1785, in check_all
self.check_logical()
File "/users/is/whughes/pyenvs/research3/lib/python2.7/site-packages/pycodestyle.py", line 1663, in check_logical
for offset, text in self.run_check(check, argument_names) or ():
File "/users/is/whughes/pyenvs/research3/lib/python2.7/site-packages/pycodestyle.py", line 633, in continued_indentation
rel_indent[end[0] - first_row] = rel_indent[row]
IndexError: list assignment index out of range
This looks like a regression on #388.
- 主要语言
- Python
- 星标
- 5.2k
- 派生
- 761
- 平均合并
- 8 小时 11 分钟
- 30 天内合并 PR
- 4
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
PyCQA/pycodestyle 的其他 Issue
-
难度 1/5 1 小时以内 新手友好度 82/100
PyCQA/pycodestyle#1294 · 1 条评论 ·
-
难度 5/5 一周以上 新手友好度 25/100
PyCQA/pycodestyle#1302 · 3 条评论 ·
-
难度 3/5 1-2 天 新手友好度 42/100
PyCQA/pycodestyle#1242 · 2 条评论 ·
-
Spurious E231 for nested format substitutions可能重新可做 关联的 PR 已关闭且未合并。 未关闭
难度 3/5 1-2 天 新手友好度 68/100
PyCQA/pycodestyle#1241 · 3 条评论 · 4 个 reaction ·
-
难度 3/5 1-2 天 新手友好度 45/100
PyCQA/pycodestyle#1217 ·
查看 PyCQA/pycodestyle 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 85/100
gramaziokohler/compas_timber#870 ·
-
bug
难度 2/5 1-3 小时 新手友好度 82/100
autowarefoundation/autoware_carla_scenario#500 ·
维护者通常 1 天内回复
-
good first issue priority: low size: XS testing
难度 1/5 1-3 小时 新手友好度 86/100
cubrid-lab/cubrid-mcp-server#385 ·
维护者通常 1 天内回复
-
good first issue priority: low size: S testing
难度 2/5 1-3 小时 新手友好度 85/100
cubrid-lab/cubrid-cookbook-python#447 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100