Skip to content

Missing syntax error for trailing backslash at end of file #10814

@correctmost

Description

@correctmost

Describe the bug

Pyright does not emit a syntax error when there's a trailing backslash at the end of a file.

Code or Screenshots

\

The same file causes a syntax error when run:

$ python y.py 
  File "y.py", line 1
    \
SyntaxError: unexpected EOF while parsing

VS Code extension or command-line
Command-line version 1.1.403

Metadata

Metadata

Assignees

No one assigned

    Labels

    addressed in next versionIssue is fixed and will appear in next published versionbugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions