Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NameError: name 'unicode' is not defined #59

Open
greatestradioshow opened this issue Jan 7, 2024 · 1 comment
Open

NameError: name 'unicode' is not defined #59

greatestradioshow opened this issue Jan 7, 2024 · 1 comment

Comments

@greatestradioshow
Copy link

greatestradioshow commented Jan 7, 2024

When running the script, I receive the following error:

PS D:\import> python import-mailbox-to-gmail.py --json Credentials.json --dir D:\import\mbox
20:11:09 INFO [email protected] *** Starting import-mailbox-to-gmail 1.5 on Python 3.8.0 (tags/v3.8.0:fa919fd, Oct 14 2019, 19:37:50) [MSC v.1916 64 bit (AMD64)] ***
20:11:09 INFO [email protected] Arguments:
20:11:09 INFO [email protected]   auth_host_name: 'localhost'
20:11:09 INFO [email protected]   auth_host_port: [8080, 8090]
20:11:09 INFO [email protected]   dir: 'D:\\import\\mbox'
20:11:09 INFO [email protected]   fix_msgid: True
20:11:09 INFO [email protected]   from_message: 0
20:11:09 INFO [email protected]   httplib2debuglevel: 0
20:11:09 INFO [email protected]   json: 'Credentials.json'
20:11:09 INFO [email protected]   log: 'import-mailbox-to-gmail-1712.log'
20:11:09 INFO [email protected]   logging_level: 'INFO'
20:11:09 INFO [email protected]   noauth_local_webserver: False
20:11:09 INFO [email protected]   num_retries: 10
20:11:09 INFO [email protected]   replace_quoted_printable: True
Traceback (most recent call last):
  File "import-mailbox-to-gmail.py", line 416, in <module>
    main()
  File "import-mailbox-to-gmail.py", line 342, in main
    for username in next(os.walk(unicode(args.dir)))[1]:
NameError: name 'unicode' is not defined

Is it possible I get the error because I try running the script with a Gmail account, not Workspace?

@eesheesh
Copy link
Collaborator

I suspect that it's because you're using Python 3, and this script was written for Python 2.7. However, it doesn't matter, because it won't work for a @gmail.com account, only Workspace accounts. :)

I'd suggest https://github.com/google/mail-importer for migrating into @gmail.com accounts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants