这是indexloc提供的服务,不要输入任何密码
Skip to content

panic: internal error: entered unreachable code: IPython escape command expression is only allowed for % and ! #21465

@correctmost

Description

@correctmost

Summary

This panic was originally reported without a reproducer at facebook/pyrefly#1559 . I was able to track it down with some targeted fuzzing:

panic: Panicked at crates/ruff_python_parser/src/parser/expression.rs:2782:13 when checking `/home/user/crash.ipynb`: `internal error: entered unreachable code: IPython escape command expression is only allowed for % and !`
--> crash.ipynb:1:1

crash.ipynb

{
  "cells": [
    {
      "cell_type": "code",
      "metadata": {},
      "outputs": [],
      "source": [
        "with a,?b\n?"
      ]
    }
  ],
  "metadata": {},
  "nbformat": 4,
  "nbformat_minor": 2
}

Version

ruff 0.14.5

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingparserRelated to the parser

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions