jonthornton / MTAPI

JSON proxy server for the MTA's realtime New York City subway feed
281 stars 84 forks source link

HTTP Error code: 255 - Is this an issue with python3.10? #41

Open thagoober opened 1 year ago

thagoober commented 1 year ago

Making note of a weird error in my aws instance, throwing me an error with import mapping innit.py

Think it might be because python 3.10 has a change re collections to collections.abc ?

Possible code fix might be:

try: from collections.abc import Mapping except ImportError: from collections import Mapping

jonhanford commented 1 year ago

I can confirm that using an older version of python fixes the issue. 3.8.16 works fine.

You should be able to install, alongside your current version, an older version of python on your aws instance. Then installing/running like this works.

$ python3.8 -m venv .venv
$ source .venv/bin/activate
$ python3.8 -m pip install -r requirements.txt
$ python3.8 app.py
jonthornton commented 1 year ago

I was unable to reproduce the error myself on a macbook, but my best guess is maybe it's caused by an old version of Flask on a new version of python. I recently updated the Flask dependency; does the latest commit at https://github.com/jonthornton/MTAPI/commit/d85e63545a0397ef30d4434abd617aab2e928ce4 fix the error for you?