@@ -498,15 +498,15 @@ def __init__(self, path, factory=None, create=True):
498498 """Initialize a single-file mailbox."""
499499 Mailbox .__init__ (self , path , factory , create )
500500 try :
501- f = open (self ._path , 'rb +' )
501+ f = open (self ._path , 'r +' )
502502 except IOError as e :
503503 if e .errno == errno .ENOENT :
504504 if create :
505- f = open (self ._path , 'wb +' )
505+ f = open (self ._path , 'w +' )
506506 else :
507507 raise NoSuchMailboxError (self ._path )
508508 elif e .errno == errno .EACCES :
509- f = open (self ._path , 'rb ' )
509+ f = open (self ._path , 'r ' )
510510 else :
511511 raise
512512 self ._file = f
@@ -1761,11 +1761,11 @@ def __init__(self, f, pos=None):
17611761
17621762 def read (self , size = None ):
17631763 """Read bytes."""
1764- return self ._read (size , self ._file .read )
1764+ return str ( self ._read (size , self ._file .read ) )
17651765
17661766 def readline (self , size = None ):
17671767 """Read a line."""
1768- return self ._read (size , self ._file .readline )
1768+ return str ( self ._read (size , self ._file .readline ) )
17691769
17701770 def readlines (self , sizehint = None ):
17711771 """Read multiple lines."""
@@ -1900,7 +1900,7 @@ def _create_carefully(path):
19001900 """Create a file if it doesn't exist and open for reading and writing."""
19011901 fd = os .open (path , os .O_CREAT | os .O_EXCL | os .O_RDWR )
19021902 try :
1903- return open (path , 'rb +' )
1903+ return open (path , 'r +' )
19041904 finally :
19051905 os .close (fd )
19061906
0 commit comments