diff -r f86d46a580d8 Lib/configparser.py --- a/Lib/configparser.py Mon Mar 18 15:20:56 2013 -0700 +++ b/Lib/configparser.py Mon Mar 18 19:49:51 2013 -0400 @@ -1090,6 +1090,8 @@ # match if it would set optval to None if optval is not None: optval = optval.strip() + if optval in ('""', "''"): + optval = '' cursect[optname] = [optval] else: # valueless option handling diff -r f86d46a580d8 Lib/test/cfgparser.1 --- a/Lib/test/cfgparser.1 Mon Mar 18 15:20:56 2013 -0700 +++ b/Lib/test/cfgparser.1 Mon Mar 18 19:49:51 2013 -0400 @@ -1,2 +1,4 @@ [Foo Bar] foo=newbar +otherfoo='' +bar="" diff -r f86d46a580d8 Lib/test/test_configparser.py --- a/Lib/test/test_configparser.py Mon Mar 18 15:20:56 2013 -0700 +++ b/Lib/test/test_configparser.py Mon Mar 18 19:49:51 2013 -0400 @@ -1447,6 +1447,15 @@ self.assertIn("foo", parser["Foo Bar"]) self.assertEqual(parser["Foo Bar"]["foo"], "newbar") + def test_empty_string_as_value(self): + """http://bugs.python.org/issue17453""" + file_path = support.findfile("cfgparser.1") + parser = configparser.ConfigParser() + with open(file_path) as f: + parser.read_file(f) + self.assertEqual(0, len(parser['Foo Bar']['otherfoo'])) + self.assertEqual(0, len(parser['Foo Bar']['bar'])) + class CoverageOneHundredTestCase(unittest.TestCase): """Covers edge cases in the codebase."""