Ignore:
Timestamp:
Mar 19, 2014, 11:31:01 PM (11 years ago)
Author:
dmik
Message:

python: Merge vendor 2.7.6 to trunk.

Location:
python/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • python/trunk

  • python/trunk/Lib/cgi.py

    r10 r391  
    3838import sys
    3939import os
    40 import urllib
    4140import UserDict
    4241import urlparse
     
    4645    if sys.py3kwarning:
    4746        filterwarnings("ignore", ".*mimetools has been removed",
    48                         DeprecationWarning)
     47                       DeprecationWarning)
     48        filterwarnings("ignore", ".*rfc822 has been removed",
     49                       DeprecationWarning)
    4950    import mimetools
    50     if sys.py3kwarning:
    51         filterwarnings("ignore", ".*rfc822 has been removed", DeprecationWarning)
    5251    import rfc822
    5352
     
    133132
    134133        keep_blank_values: flag indicating whether blank values in
    135             URL encoded forms should be treated as blank strings.
     134            percent-encoded forms should be treated as blank strings.
    136135            A true value indicates that blanks should be retained as
    137136            blank strings.  The default false value indicates that
     
    173172            qs = ""
    174173        environ['QUERY_STRING'] = qs    # XXX Shouldn't, really
    175     return parse_qs(qs, keep_blank_values, strict_parsing)
     174    return urlparse.parse_qs(qs, keep_blank_values, strict_parsing)
    176175
    177176
     
    181180def parse_qs(qs, keep_blank_values=0, strict_parsing=0):
    182181    """Parse a query given as a string argument."""
    183     warn("cgi.parse_qs is deprecated, use urlparse.parse_qs \
    184             instead", PendingDeprecationWarning, 2)
     182    warn("cgi.parse_qs is deprecated, use urlparse.parse_qs instead",
     183         PendingDeprecationWarning, 2)
    185184    return urlparse.parse_qs(qs, keep_blank_values, strict_parsing)
    186185
     
    294293        s = s[1:]
    295294        end = s.find(';')
    296         while end > 0 and s.count('"', 0, end) % 2:
     295        while end > 0 and (s.count('"', 0, end) - s.count('\\"', 0, end)) % 2:
    297296            end = s.find(';', end + 1)
    298297        if end < 0:
     
    412411
    413412        keep_blank_values: flag indicating whether blank values in
    414             URL encoded forms should be treated as blank strings.
     413            percent-encoded forms should be treated as blank strings.
    415414            A true value indicates that blanks should be retained as
    416415            blank strings.  The default false value indicates that
     
    699698                self.done = -1
    700699                break
     700            if delim == "\r":
     701                line = delim + line
     702                delim = ""
    701703            if line[:2] == "--" and last_line_lfend:
    702704                strippedline = line.strip()
     
    715717                line = line[:-1]
    716718                last_line_lfend = True
     719            elif line[-1] == "\r":
     720                # We may interrupt \r\n sequences if they span the 2**16
     721                # byte boundary
     722                delim = "\r"
     723                line = line[:-1]
     724                last_line_lfend = False
    717725            else:
    718726                delim = ""
Note: See TracChangeset for help on using the changeset viewer.