Skip to content

Commit

Permalink
Resolve comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Agent-Hellboy committed Aug 5, 2023
1 parent 7ae72b6 commit da065f8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
12 changes: 5 additions & 7 deletions Doc/library/configparser.rst
Original file line number Diff line number Diff line change
Expand Up @@ -956,6 +956,11 @@ ConfigParser Objects
converter gets its own corresponding :meth:`get*()` method on the parser
object and section proxies.

Raise a :exc:`ParsingError` instead of an :exc:`AttributeError` for
:meth:`read` and :meth:`read_file` if the configuration contains
a key without a corresponding value in scenarios where configuration
contains extra space or newline within a section.

.. versionchanged:: 3.1
The default *dict_type* is :class:`collections.OrderedDict`.

Expand Down Expand Up @@ -1030,13 +1035,6 @@ ConfigParser Objects
directory), and all existing configuration files in the iterable will be
read.

Raise :exc:`ParsingError` instead of :exc:`AttributeError`
when the configuration contains a key without a corresponding value.
This change is intended to handle scenarios where a key lacks a value
in a configuration which contains extra space or newline within a section.
Please note that it's not recommended to have extra spaces
or blank lines within sections of the configuration.

If none of the named files exist, the :class:`ConfigParser`
instance will contain an empty dataset. An application which requires
initial values to be loaded from a file should load the required file or
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
Raise an :exc:`ParsingError` instead of an :exc:`AttributeError` when the configuration contains a key without a corresponding value in a scenario where extra space or a new line is present within the section.
Emit :exc:`ParsingError` from :meth:`read` and :meth:`read_file`
of :class:`ConfigParser` if configuration contains a key
without a corresponding value in a scenario where extra space
or a new line is present within the section.

0 comments on commit da065f8

Please sign in to comment.