tommeagher / heroku_ebooks

An archive of a script to generate Markov chains and to post to an _ebooks account on Twitter using Heroku. No longer actively supported.
264 stars 163 forks source link

[ISSUE] Syntax Error #17

Closed rtd62 closed 7 years ago

rtd62 commented 8 years ago

After pushing the files to the master app on Heroku and running "worker", I get these two errors:

Running worker on ⬢ secret-taiga-39619... up, run.2390 Traceback (most recent call last): File "ebooks.py", line 7, in <module> from local_settings import * File "/app/local_settings.py", line 12 SOURCE_ACCOUNTS = [“frontend_bot”] ^ SyntaxError: invalid syntax

tommeagher commented 8 years ago

This is very odd. Were you able to resolve this issue? I have two theories:

Furgersen7 commented 7 years ago

I am having the same issue with syntax as well. When I run my worker I get these errors:

Traceback (most recent call last): File "ebooks.py", line 7, in <module> from local_settings import * File "/app/local_settings.py", line 11 SyntaxError: Non-ASCII character '\xe2' in file /app/local_settings.py on line 11, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details

tommeagher commented 7 years ago

Hi @Furgersen7, if this StackOverflow thread is accurate, it seems you might have introduced a stray byte in your local_settings.py somehow. Here's a promising solution. Do you want to try it?

mackmo commented 7 years ago

I am also having this issue, and have tried all the solutions posed on StackOverflow. Any suggestions?

tommeagher commented 7 years ago

@mackmo, so you're certain you're not using smartquotes inadvertently? What kind of text editor are you using?

mackmo commented 7 years ago

I'm using Mac's TextEdit program. All smart options are off, and I've run it through this diacritics remover with no issues, but it still won't run.

tommeagher commented 7 years ago

What error message you getting, @mackmo?

mackmo commented 7 years ago

Here's the message: Traceback (most recent call last): File "ebooks.py", line 7, in <module> from local_settings import * File "/app/local_settings.py", line 7 SyntaxError: Non-ASCII character '\xe2' in file /app/local_settings.py on line 7, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details

tommeagher commented 7 years ago

@mackmo I don't know much about TextEdit. You should try something like TextWrangler. With that, you can turn on View>Text Display>Show Invisibles to see that extra character that snuck in there.

mackmo commented 7 years ago

Thanks! Problem solved, I'll stick to TextWrangler from now on.

tommeagher commented 7 years ago

@mackmo 👍🏼