google / import-mailbox-to-gmail

Import .mbox files into Google Workspace

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

os.walk error

jevilsizor opened this issue · comments

(Python2.7) root@LT2226:/mnt/c/python# python import-mailbox-to-gmail.py --json /MBOX/Credentials.json --dir /MBOX --logging_level INFO
15:31:08 INFO main@import-mailbox-to-gmail.py *** Starting import-mailbox-to-gmail 1.5 on Python 2.7.12 (default, Dec 4 2017, 14:50:18)
[GCC 5.4.0 20160609] ***
15:31:08 INFO main@import-mailbox-to-gmail.py Arguments:
15:31:08 INFO main@import-mailbox-to-gmail.py auth_host_name: 'localhost'
15:31:08 INFO main@import-mailbox-to-gmail.py auth_host_port: [8080, 8090]
15:31:08 INFO main@import-mailbox-to-gmail.py dir: '/MBOX'
15:31:08 INFO main@import-mailbox-to-gmail.py fix_msgid: True
15:31:08 INFO main@import-mailbox-to-gmail.py from_message: 0
15:31:08 INFO main@import-mailbox-to-gmail.py httplib2debuglevel: 0
15:31:08 INFO main@import-mailbox-to-gmail.py json: '/MBOX/Credentials.json'
15:31:08 INFO main@import-mailbox-to-gmail.py log: 'import-mailbox-to-gmail-535.log'
15:31:08 INFO main@import-mailbox-to-gmail.py logging_level: 'INFO'
15:31:08 INFO main@import-mailbox-to-gmail.py noauth_local_webserver: False
15:31:08 INFO main@import-mailbox-to-gmail.py num_retries: 10
15:31:08 INFO main@import-mailbox-to-gmail.py replace_quoted_printable: True
Traceback (most recent call last):
File "import-mailbox-to-gmail.py", line 415, in
main()
File "import-mailbox-to-gmail.py", line 341, in main
for username in next(os.walk(args.dir))[1]:
StopIteration

any ideas?

Based on https://stackoverflow.com/a/37289741/3275273, it looks like the directory you specified (/MBOX) doesn't exist. Please let me know if this is the case.

I'll leave this open anyway because it needs a better error message.

Thanks for reporting!

In that case, you should probably use -dir mbox, without the slash. The slash means it will search for c:\mbox.

Also, in Windows it's generally better to use backslashes for paths, as not everything works well with forward slashes.

Please let me know if it works.

Thanks!