Skip to content

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

@correctmost

Description

@correctmost

Summary

I ran some follow-up tests for #21465 and found a similar notebook crash:

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

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

Version

ruff 0.14.7

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingnotebookRelated to (Jupyter) notebooksparserRelated to the parser

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions