1
0
Fork 1
mirror of https://github.com/coddingtonbear/django-mailbox.git synced 2026-07-09 22:38:19 +02:00

possible fix for python3 maildir issue

This commit is contained in:
Leifur Halldor Asgeirsson 2015-07-21 11:50:15 -04:00 committed by Adam Coddington
parent f706cacd27
commit 55be6b37f2

View file

@ -1,4 +1,5 @@
import sys
import six
from .base import EmailTransport
@ -9,9 +10,12 @@ class GenericFileMailbox(EmailTransport):
def __init__(self, path):
super(GenericFileMailbox, self).__init__()
self._path = path.encode(
sys.getfilesystemencoding()
)
if six.PY2:
self._path = path.encode(
sys.getfilesystemencoding()
)
else:
self._path = path
def get_instance(self):
return self._variant(self._path)