Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 80073 | Differences between
and this patch

Collapse All | Expand All

(-)getmail-4.2.5-orig/getmailcore/message.py (-4 / +17 lines)
Lines 7-12 Link Here
7
    'Message',
7
    'Message',
8
]
8
]
9
9
10
import sys
10
import os
11
import os
11
import time
12
import time
12
import cStringIO
13
import cStringIO
Lines 86-105 Link Here
86
        # of filters, etc, which should be saner.
87
        # of filters, etc, which should be saner.
87
        if fromlines:
88
        if fromlines:
88
            try:
89
            try:
89
                self.__msg = email.message_from_string(os.linesep.join(
90
                if sys.version_info < (2, 4):
90
                    fromlines), strict=False)
91
                    self.__msg = email.message_from_string(os.linesep.join(
92
                            fromlines), strict=False)
93
                else:
94
                    self.__msg = email.message_from_string(os.linesep.join(
95
                            fromlines))
91
            except email.Errors.MessageError, o:
96
            except email.Errors.MessageError, o:
92
                self.__msg = corrupt_message(o, fromlines=fromlines)
97
                self.__msg = corrupt_message(o, fromlines=fromlines)
93
            self.__raw = os.linesep.join(fromlines)
98
            self.__raw = os.linesep.join(fromlines)
94
        elif fromstring:
99
        elif fromstring:
95
            try:
100
            try:
96
                self.__msg = email.message_from_string(fromstring, strict=False)
101
                if sys.version_info < (2, 4):
102
                    self.__msg = email.message_from_string(fromstring,
103
                                                           strict=False)
104
                else:
105
                    self.__msg = email.message_from_string(fromstring)
97
            except email.Errors.MessageError, o:
106
            except email.Errors.MessageError, o:
98
                self.__msg = corrupt_message(o, fromstring=fromstring)
107
                self.__msg = corrupt_message(o, fromstring=fromstring)
99
            self.__raw = fromstring
108
            self.__raw = fromstring
100
        elif fromfile:
109
        elif fromfile:
101
            try:
110
            try:
102
                self.__msg = email.message_from_file(fromfile, strict=False)
111
                if sys.version_info < (2, 4):
112
                    self.__msg = email.message_from_file(fromfile,
113
                                                         strict=False)
114
                else:
115
                    self.__msg = email.message_from_file(fromfile)
103
            except email.Errors.MessageError, o:
116
            except email.Errors.MessageError, o:
104
                # Shouldn't happen
117
                # Shouldn't happen
105
                self.__msg = corrupt_message(o, fromstring=fromfile.read())
118
                self.__msg = corrupt_message(o, fromstring=fromfile.read())
(-)getmail-4.2.5-orig/getmailcore/_retrieverbases.py (-1 / +6 lines)
Lines 33-38 Link Here
33
    'RetrieverSkeleton',
33
    'RetrieverSkeleton',
34
]
34
]
35
35
36
import sys
36
import os
37
import os
37
import socket
38
import socket
38
import time
39
import time
Lines 426-432 Link Here
426
        self.log.trace()
427
        self.log.trace()
427
        msgnum = self._getmsgnumbyid(msgid)
428
        msgnum = self._getmsgnumbyid(msgid)
428
        response, headerlist, octets = self.conn.top(msgnum, 0)
429
        response, headerlist, octets = self.conn.top(msgnum, 0)
429
        parser = email.Parser.Parser(strict=False)
430
        # 'strict' argument is deprecated (and unneeded) in python 2.4
431
        if sys.version_info < (2, 4):
432
            parser = email.Parser.Parser(strict=False)
433
        else:
434
            parser = email.Parser.Parser()
430
        return parser.parsestr(os.linesep.join(headerlist), headersonly=True)
435
        return parser.parsestr(os.linesep.join(headerlist), headersonly=True)
431
436
432
    def initialize(self):
437
    def initialize(self):

Return to bug 80073