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

Filename too long #22

Closed
talsafran opened this issue Dec 15, 2016 · 3 comments
Closed

Filename too long #22

talsafran opened this issue Dec 15, 2016 · 3 comments

Comments

@talsafran
Copy link

talsafran commented Dec 15, 2016

Hi there,

I'm setting this up on a macOS Sierra system and have an issue when running the actual import command.

I get the following trace:

$ ./import-mailbox-to-gmail.py --json "/Users/tal/Downloads/Chrome/Josephine\ Email\ Import-1185bda2bfc5.json" --dir mbox
./import-mailbox-to-gmail.py: line 18: Import mbox files to a specified label for many users.

Liron Newman lironn@google.com

Copyright 2015 Google Inc. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the License);
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an AS: File name too long
import: unable to grab mouse `': Resource temporarily unavailable @ error/xwindow.c/XSelectWindow/9202.
import: unable to grab mouse `': Resource temporarily unavailable @ error/xwindow.c/XSelectWindow/9202.
import: unable to grab mouse `': Resource temporarily unavailable @ error/xwindow.c/XSelectWindow/9202.
import: unable to grab mouse `': Resource temporarily unavailable @ error/xwindow.c/XSelectWindow/9202.
import: unable to grab mouse `': Resource temporarily unavailable @ error/xwindow.c/XSelectWindow/9202.
import: unable to grab mouse `': Resource temporarily unavailable @ error/xwindow.c/XSelectWindow/9202.
import: unable to grab mouse `': Resource temporarily unavailable @ error/xwindow.c/XSelectWindow/9202.
import: unable to grab mouse `': Resource temporarily unavailable @ error/xwindow.c/XSelectWindow/9202.
import: unable to grab mouse `': Resource temporarily unavailable @ error/xwindow.c/XSelectWindow/9202.
from: can't read /var/mail/apiclient
from: can't read /var/mail/apiclient.http
import: unable to grab mouse `': Resource temporarily unavailable @ error/xwindow.c/XSelectWindow/9202.
from: can't read /var/mail/apiclient.http
from: can't read /var/mail/oauth2client.service_account
import: unable to grab mouse `': Resource temporarily unavailable @ error/xwindow.c/XSelectWindow/9202.
import: unable to grab mouse `': Resource temporarily unavailable @ error/xwindow.c/XSelectWindow/9202.
./import-mailbox-to-gmail.py: line 38: APPLICATION_NAME: command not found
./import-mailbox-to-gmail.py: line 39: APPLICATION_VERSION: command not found
./import-mailbox-to-gmail.py: line 41: SCOPES: command not found
./import-mailbox-to-gmail.py: line 42: https://www.googleapis.com/auth/gmail.labels]: No such file or directory
./import-mailbox-to-gmail.py: line 45: syntax error near unexpected token `('
./import-mailbox-to-gmail.py: line 45: `parser = argparse.ArgumentParser('

Here is my tree structure, which I believe follows the instructions:

tal at Tals-MacBook-Air in ~/Projects/josephine-gmail-import
$ tree .
.
├── import-mailbox-to-gmail.py
└── mbox
    └── email@example.com
        └── All mail Including Spam and Trash.mbox

2 directories, 2 files

I have Python and Pip installed via Homebrew.

tal at Tals-MacBook-Air in ~/Projects/josephine-gmail-import
$ pip --version
pip 9.0.1 from /usr/local/lib/python2.7/site-packages (python 2.7)
tal at Tals-MacBook-Air in ~/Projects/josephine-gmail-import
$ python --version
Python 2.7.12
tal at Tals-MacBook-Air in ~/Projects/josephine-gmail-import
$ which python
/usr/local/bin/python

Any ideas? Happy to provide more system background etc. Thanks!

@eesheesh
Copy link
Collaborator

The output is strange - looks like it isn't Python that's interpreting the file. Can you try to run it like this?
python import-mailbox-to-gmail.py --json "/Users/tal/Downloads/Chrome/Josephine\ Email\ Import-1185bda2bfc5.json" --dir mbox

Your directory structure seems ok, so I don't think that would be an issue.

Thanks!

@simonebracaloni
Copy link

The shebang is missing in the python script.
If you want to run the script without typing "python" (as described in the documentation ./import-mailbox-to-gmail.py), you have to put
#!/usr/bin/env python
in the very first line of the script.
https://en.wikipedia.org/wiki/Shebang_(Unix)

This way the shell will know which interpreter it has to use.

@eesheesh
Copy link
Collaborator

Thanks @simonebracaloni! Good catch!

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

3 participants