cpython: 5257bb466d18 (original) (raw)

Mercurial > cpython

changeset 77980:5257bb466d18

Fixes #14590: ConfigParser doesn't strip inline comment when delimiter occurs earlier without preceding space. [#14590]

Ɓukasz Langa lukasz@langa.pl
date Sat, 07 Jul 2012 18:54:08 +0200
parents b51a85ed3e63
children 8f9e391c1e6c
files Lib/configparser.py Lib/test/test_configparser.py
diffstat 2 files changed, 51 insertions(+), 6 deletions(-)[+] [-] Lib/configparser.py 20 Lib/test/test_configparser.py 37

line wrap: on

line diff

--- a/Lib/configparser.py +++ b/Lib/configparser.py @@ -993,18 +993,26 @@ class RawConfigParser(MutableMapping): indent_level = 0 e = None # None, or an exception for lineno, line in enumerate(fp, start=1):

--- a/Lib/test/test_configparser.py +++ b/Lib/test/test_configparser.py @@ -1618,6 +1618,42 @@ class ExceptionPicklingTestCase(unittest self.assertEqual(repr(e1), repr(e2)) +class InlineCommentStrippingTestCase(unittest.TestCase):

+

+

+ + def test_main(): support.run_unittest( ConfigParserTestCase, @@ -1640,4 +1676,5 @@ def test_main(): ReadFileTestCase, CoverageOneHundredTestCase, ExceptionPicklingTestCase,