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

cleanup.py invalid syntax #16

Open
kikieri opened this issue May 23, 2022 · 2 comments
Open

cleanup.py invalid syntax #16

kikieri opened this issue May 23, 2022 · 2 comments

Comments

@kikieri
Copy link

kikieri commented May 23, 2022

Hey guys,
thanks for this awesome little helper.
I have problems to get it running.
When I do
python cleanup.py 100
It says:
File "cleanup.py", line 27
def get_email_headers(email) -> dict:
^
SyntaxError: invalid syntax
exit 1

Any help

@jramirez857
Copy link
Owner

Hello, great to hear you've found this helper script useful! I wonder if the issue you are seeing is due to the -> return type annotation since I see this is the only function in that file with that syntax. Which python version are you running?

@kikieri
Copy link
Author

kikieri commented May 23, 2022

Ok. More Infos for you :) Sorry
Running MacOSX. Installed last version of python 3.10.
New output since I updated my python (had an old version running)
after "python3 cleanup.py 100" command

Traceback (most recent call last):
File "/Users/kalucci/Downloads/email-cleaner/cleanup.py", line 216, in
typer.run(main)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/typer/main.py", line 864, in run
app()
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/typer/main.py", line 214, in call
return get_command(self)(*args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/click/core.py", line 1128, in call
return self.main(*args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/click/core.py", line 1053, in main
rv = self.invoke(ctx)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/click/core.py", line 1395, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/click/core.py", line 754, in invoke
return __callback(*args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/typer/main.py", line 500, in wrapper
return callback(**use_params) # type: ignore
File "/Users/kalucci/Downloads/email-cleaner/cleanup.py", line 211, in main
emails = EmailFetcher().get(num_emails)
File "/Users/kalucci/Downloads/email-cleaner/cleanup.py", line 64, in init
self.gmail = GmailService().get()
File "/Users/kalucci/Downloads/email-cleaner/gmail.py", line 50, in get
return build("gmail", "v1", credentials=self._get_credentials())
File "/Users/kalucci/Downloads/email-cleaner/gmail.py", line 38, in _get_credentials
flow = InstalledAppFlow.from_client_secrets_file(
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/google_auth_oauthlib/flow.py", line 202, in from_client_secrets_file
client_config = json.load(json_file)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/json/init.py", line 293, in load
return loads(fp.read(),
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/json/init.py", line 346, in loads
return _default_decoder.decode(s)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

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