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/email/feedparser.py

    r2 r391  
    1414This completes the parsing and returns the root message object.
    1515
    16 The other advantage of this parser is that it will never throw a parsing
     16The other advantage of this parser is that it will never raise a parsing
    1717exception.  Instead, when it finds something unexpected, it adds a 'defect' to
    1818the current message.  Defects are just instances that live on the message
     
    2929NLCRE = re.compile('\r\n|\r|\n')
    3030NLCRE_bol = re.compile('(\r\n|\r|\n)')
    31 NLCRE_eol = re.compile('(\r\n|\r|\n)$')
     31NLCRE_eol = re.compile('(\r\n|\r|\n)\Z')
    3232NLCRE_crack = re.compile('(\r\n|\r|\n)')
    3333# RFC 2822 $3.6.8 Optional fields.  ftext is %d33-57 / %d59-126, Any character
     
    106106        # this is the empty string.
    107107        self._partial = parts.pop()
     108        #GAN 29Mar09  bugs 1555570, 1721862  Confusion at 8K boundary ending with \r:
     109        # is there a \n to follow later?
     110        if not self._partial and parts and parts[-1].endswith('\r'):
     111            self._partial = parts.pop(-2)+parts.pop()
    108112        # parts is a list of strings, alternating between the line contents
    109113        # and the eol character(s).  Gather up a list of lines after
     
    213217        self._parse_headers(headers)
    214218        # Headers-only parsing is a backwards compatibility hack, which was
    215         # necessary in the older parser, which could throw errors.  All
     219        # necessary in the older parser, which could raise errors.  All
    216220        # remaining lines in the input are thrown into the message body.
    217221        if self._headersonly:
Note: See TracChangeset for help on using the changeset viewer.