docker-offlineimap/offlineimap/repository
Łukasz Żarnowiecki 48ae1a36c8 maildir: Create top level dir recursively
This patch fixes the situation when "localfolders" specifies path that
is more that one level deep and top directory does not exists.  Example
would be "localfolders = ~/Mail/a".  This especially relevant on the
first run.

In that case we would end up with unhandled exception causing
unexpected termination of the program.

Thread 'Account sync test' terminated with exception:
Traceback (most recent call last):
  File "/offlineimap/offlineimap/threadutil.py", line 172, in run
    Thread.run(self)
  File "/usr/lib/python2.7/threading.py", line 754, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/offlineimap/offlineimap/accounts.py", line 258, in syncrunner
    self.localrepos  = Repository(self, 'local')
  File "/offlineimap/offlineimap/repository/__init__.py", line 82, in __new__
    return repo(name, account)
  File "/offlineimap/offlineimap/repository/Maildir.py", line 40, in __init__
    os.mkdir(self.root, 0o700)
OSError: [Errno 2] No such file or directory: '/Mail/a'

By replacing call to "mkdir" with "makedirs" we can simply create
directories recursively.

Signed-off-by: Łukasz Żarnowiecki <dolohow@outlook.com>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
2016-06-01 19:49:55 +02:00
..
__init__.py py3: raise exceptions using six module 2016-05-18 01:49:09 +02:00
Base.py Replace dictionary iteration methods 2016-05-16 23:18:26 +02:00
Gmail.py do use the XOAUTH2 url if configured 2015-10-12 07:51:05 +02:00
GmailMaildir.py repository: GmailMaildir: fix copyright 2015-01-14 18:01:05 +01:00
IMAP.py threading: fix variable names about namespaces 2016-05-19 08:36:23 +02:00
LocalStatus.py make sqlite status cache the default 2016-04-09 21:06:38 +02:00
Maildir.py maildir: Create top level dir recursively 2016-06-01 19:49:55 +02:00