[Python-checkins] python/dist/src/Lib ConfigParser.py,1.38.10.3,1.38.10.4
fdrake@users.sourceforge.net
fdrake@users.sourceforge.net
Fri, 27 Sep 2002 09:34:32 -0700
Update of /cvsroot/python/python/dist/src/Lib
In directory usw-pr-cvs1:/tmp/cvs-serv7816
Modified Files:
Tag: release22-maint
ConfigParser.py
Log Message:
Allow internal whitespace in keys.
Closes SF bug #583248.
Index: ConfigParser.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/ConfigParser.py,v
retrieving revision 1.38.10.3
retrieving revision 1.38.10.4
diff -C2 -d -r1.38.10.3 -r1.38.10.4
*** ConfigParser.py 26 Sep 2002 19:37:36 -0000 1.38.10.3
--- ConfigParser.py 27 Sep 2002 16:34:30 -0000 1.38.10.4
***************
*** 386,390 ****
)
OPTCRE = re.compile(
! r'(?P<option>[^:=\s]+)' # very permissive!
r'\s*(?P<vi>[:=])\s*' # any number of space/tab,
# followed by separator
--- 386,390 ----
)
OPTCRE = re.compile(
! r'(?P<option>[^:=\s][^:=]*)' # very permissive!
r'\s*(?P<vi>[:=])\s*' # any number of space/tab,
# followed by separator
***************
*** 416,420 ****
if line.strip() == '' or line[0] in '#;':
continue
! if line.split(None, 1)[0].lower() == 'rem' and line[0] in "rR": # no leading whitespace
continue
# continuation line?
--- 416,421 ----
if line.strip() == '' or line[0] in '#;':
continue
! if line.split(None, 1)[0].lower() == 'rem' and line[0] in "rR":
! # no leading whitespace
continue
# continuation line?
***************
*** 456,460 ****
if optval == '""':
optval = ''
! optname = self.optionxform(optname)
cursect[optname] = optval
else:
--- 457,461 ----
if optval == '""':
optval = ''
! optname = self.optionxform(optname.rstrip())
cursect[optname] = optval
else: