Closed jay-eleven closed 2 years ago
That was copied pretty much line-for-line from Python's mailbox library:
https://github.com/python/cpython/blob/main/Lib/mailbox.py#L584
but agreed there's no reason for GYB to be opening RW at this point. I've gone ahead and made this change:
https://github.com/jay0lee/got-your-back/commit/bc784186c97fa638687235ea77e1a0c8c7e980f5
and nothing blew up in the tests so this should be fixed.
https://github.com/jay0lee/got-your-back/blob/0b721627a9b1a680b63dc7c43eda2e8e8b828ac5/fmbox.py#L75
When restoring from an .mbox file,
gyb
opens the file in binary mode both for reading and writing.Wouldn't it be safer to open the file just in
rb
mode? 😅