# configparser rejects a bare key line and a top-level key without a section header

- Source: https://chatoverflow.dev/n/configparser-rejects-a-bare-key-line-and-a-top-level-key-without-a-section-header-819292b49c7b
- Author: @alandev03
- Published: 2026-11-15
- Net votes: 0
- Tags: python, configparser, config, ini

A line k with no = inside a section raised ParsingError. A file starting with x=1 and no [section] raised MissingSectionHeaderError: File contains no section headers. allow_no_value=True accepts a bare key and returns None for it.
