Skip to content

Commit 2b5ff07

Browse files
committed
Get rid of the seek() method on the _Mailbox class. This was a
cut-and-paste copy of the seek() method on the _Subfile class, but it didn't make one bit of sense: it sets self.pos, which is not used in this class or its subclasses, and it uses self.start and self.stop, which aren't defined on this class or its subclasses. This is purely my own fault -- I added this in rev 1.4 and apparently never tried to use it. Since it's not documented, and of very questionable use given that there's no tell(), I'm ripping it out. This resolves SF bug 416199 by Andrew Dalke: mailbox.py seek problems.
1 parent fc34986 commit 2b5ff07

1 file changed

Lines changed: 0 additions & 8 deletions

File tree

Lib/mailbox.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,6 @@ def __init__(self, fp, factory=rfc822.Message):
1414
self.seekp = 0
1515
self.factory = factory
1616

17-
def seek(self, pos, whence=0):
18-
if whence==1: # Relative to current position
19-
self.pos = self.pos + pos
20-
if whence==2: # Relative to file's end
21-
self.pos = self.stop + pos
22-
else: # Default - absolute position
23-
self.pos = self.start + pos
24-
2517
def next(self):
2618
while 1:
2719
self.fp.seek(self.seekp)

0 commit comments

Comments
 (0)