Skip to content

Malformed pyproject.toml crashes with a TOMLDecodeError traceback instead of a clear error #893

Closed

Description

@tdstein

🤖 A pyproject.toml that doesn't parse produces an uncaught TOMLDecodeError traceback and Internal error, with no user-facing message.

Repro

mkdir p && cd p
printf 'from flask import Flask\napp = Flask(__name__)\n' > app.py
echo flask > requirements.txt
printf '[project\nname = "x"\n' > pyproject.toml
rsconnect write-manifest api .
tomllib.TOMLDecodeError: Expected ']' at the end of a table declaration (at line 1, column 9)
[ERROR]
Internal error: Expected ']' at the end of a table declaration (at line 1, column 9)

This happens even when pyproject.toml isn't the requirements source. The root file is parsed while detecting the Python version requirement (detect_python_version_requirement), before any code that would turn the parse error into a clear message.

Expected

An RSConnectException such as Error reading pyproject.toml: <reason>, with no traceback.

Found during live QA of #892 against Posit Connect. Reproduced on 1.32.0 and current main (0287aca3).

Activity

  1. added
    bugSomething isn't working
    ready-for-agentFully specified, ready for an autonomous coding agent
    on Oct 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingready-for-agentFully specified, ready for an autonomous coding agent

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions