mirror of
https://github.com/coddingtonbear/django-mailbox.git
synced 2026-07-10 06:48:19 +02:00
possible fix for python3 maildir issue
This commit is contained in:
parent
498f38c461
commit
9610e86f50
1 changed files with 7 additions and 3 deletions
|
|
@ -1,4 +1,5 @@
|
||||||
import sys
|
import sys
|
||||||
|
import six
|
||||||
|
|
||||||
from .base import EmailTransport
|
from .base import EmailTransport
|
||||||
|
|
||||||
|
|
@ -9,9 +10,12 @@ class GenericFileMailbox(EmailTransport):
|
||||||
|
|
||||||
def __init__(self, path):
|
def __init__(self, path):
|
||||||
super(GenericFileMailbox, self).__init__()
|
super(GenericFileMailbox, self).__init__()
|
||||||
|
if six.PY2:
|
||||||
self._path = path.encode(
|
self._path = path.encode(
|
||||||
sys.getfilesystemencoding()
|
sys.getfilesystemencoding()
|
||||||
)
|
)
|
||||||
|
else:
|
||||||
|
self._path = path
|
||||||
|
|
||||||
def get_instance(self):
|
def get_instance(self):
|
||||||
return self._variant(self._path)
|
return self._variant(self._path)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue