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

TypeError #16

Closed
realswamo opened this issue Oct 23, 2020 · 3 comments
Closed

TypeError #16

realswamo opened this issue Oct 23, 2020 · 3 comments

Comments

@realswamo
Copy link

realswamo commented Oct 23, 2020

Hello, when I run the script it is giving me a type error:

Traceback (most recent call last):
File "app.py", line 62, in
threaded=app.config['THREADED'])
File "/home/pi/Desktop/MTAPI-master/mtapi/mtapi.py", line 84, in init
self._stations = json.load(f)
File "/usr/lib/python3.5/json/init.py", line 268, in load
parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)
File "/usr/lib/python3.5/json/init.py", line 312, in loads
s.class.name))
TypeError: the JSON object must be str, not 'bytes'

I deleted the folder and re-did all the installation. Thanks for creating this, it really comes in handy!

@realswamo realswamo changed the title Import Error TypeError Oct 23, 2020
@jonthornton
Copy link
Owner

This kinda looks like a problem with STATIONS_FILE in the config. What does your settings.cfg look like? (Don't share your MTA API key)

@realswamo
Copy link
Author

Hey there, here is what my settings.cfg looks:

MTA_KEY = '***************'
STATIONS_FILE = './data/stations.json'
CROSS_ORIGIN = ''
MAX_TRAINS=10
MAX_MINUTES=30
CACHE_SECONDS=60
THREADED=True
DEBUG = True

@jonthornton
Copy link
Owner

Should be fixed in a0b421a

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