[Python-checkins] CVS: python/dist/src/Lib Cookie.py,1.6,1.7

A.M. Kuchling akuchling@users.sourceforge.net
Tue, 20 Feb 2001 14:11:26 -0800


Update of /cvsroot/python/python/dist/src/Lib
In directory usw-pr-cvs1:/tmp/cvs-serv8466

Modified Files:
	Cookie.py 
Log Message:
Patch #103473 from dougfort: Some sites (amazon.com for one) drop
cookies that contain '=' as part of the value. This patch modifies
Cookie.py to allow '=' as a legal character, and to make the key
search nongreedy so it stops at the first '='.


Index: Cookie.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/Cookie.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** Cookie.py	2001/01/20 19:54:20	1.6
--- Cookie.py	2001/02/20 22:11:24	1.7
***************
*** 522,530 ****
  #
  
! _LegalCharsPatt  = r"[\w\d!#%&'~_`><@,:/\$\*\+\-\.\^\|\)\(\?\}\{]"
  _CookiePattern = re.compile(
      r"(?x)"                       # This is a Verbose pattern
      r"(?P<key>"                   # Start of group 'key'
!     ""+ _LegalCharsPatt +"+"        # Any word of at least one letter
      r")"                          # End of group 'key'
      r"\s*=\s*"                    # Equal Sign
--- 522,530 ----
  #
  
! _LegalCharsPatt  = r"[\w\d!#%&'~_`><@,:/\$\*\+\-\.\^\|\)\(\?\}\{\=]"
  _CookiePattern = re.compile(
      r"(?x)"                       # This is a Verbose pattern
      r"(?P<key>"                   # Start of group 'key'
!     ""+ _LegalCharsPatt +"+?"     # Any word of at least one letter, nongreedy
      r")"                          # End of group 'key'
      r"\s*=\s*"                    # Equal Sign