Show More
@@ -28,9 +28,6 from typing import ( | |||
|
28 | 28 | ) |
|
29 | 29 | |
|
30 | 30 | from .i18n import _ |
|
31 | from .pycompat import ( | |
|
32 | open, | |
|
33 | ) | |
|
34 | 31 | from . import ( |
|
35 | 32 | encoding, |
|
36 | 33 | error, |
@@ -221,7 +218,7 def _sendmail(ui, sender, recipients, ms | |||
|
221 | 218 | def _mbox(mbox, sender, recipients, msg): |
|
222 | 219 | '''write mails to mbox''' |
|
223 | 220 | # TODO: use python mbox library for proper locking |
|
224 |
with open(mbox, |
|
|
221 | with open(mbox, 'ab+') as fp: | |
|
225 | 222 | # Should be time.asctime(), but Windows prints 2-characters day |
|
226 | 223 | # of month instead of one. Make them print the same thing. |
|
227 | 224 | date = time.strftime('%a %b %d %H:%M:%S %Y', time.localtime()) |
@@ -237,7 +234,7 def connect(ui, mbox=None): | |||
|
237 | 234 | """make a mail connection. return a function to send mail. |
|
238 | 235 | call as sendmail(sender, list-of-recipients, msg).""" |
|
239 | 236 | if mbox: |
|
240 |
open(mbox, |
|
|
237 | open(mbox, 'wb').close() | |
|
241 | 238 | return lambda s, r, m: _mbox(mbox, s, r, m) |
|
242 | 239 | if ui.config(b'email', b'method') == b'smtp': |
|
243 | 240 | return _smtp(ui) |
General Comments 0
You need to be logged in to leave comments.
Login now