Nextdoor / ndscheduler

A flexible python library for building your own cron-like system, with REST APIs and a Web UI.
BSD 2-Clause "Simplified" License
1.09k stars 201 forks source link

Not compatible with Python 3.5 #14

Closed rhaarm closed 6 years ago

rhaarm commented 7 years ago

Traceback (most recent call last): File "/usr/local/lib/python3.5/site-packages/tornado/web.py", line 1443, in _execute result = method(*self.path_args, **self.path_kwargs) File "/src/ndscheduler/ndscheduler/server/handlers/index.py", line 16, in get meta_info = utils.get_all_available_jobs() File "/src/ndscheduler/ndscheduler/utils.py", line 155, in get_all_available_jobs job_module = importlib.import_module('%s.%s' % (job_class_package, module_name)) File "/usr/local/lib/python3.5/importlib/init.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 986, in _gcd_import File "", line 969, in _find_and_load File "", line 958, in _find_and_load_unlocked File "", line 673, in _load_unlocked File "", line 673, in exec_module File "", line 222, in _call_with_frames_removed File "/src/ndscheduler/simple_scheduler/jobs/apns_job.py", line 7, in from apns import APNs, Payload File "/usr/local/lib/python3.5/site-packages/apns.py", line 218 except ssl.SSLError, err: ^ SyntaxError: invalid syntax 2017-05-04 21:05:03,639 - tornado.access - ERROR - 500 GET / (172.17.0.1) 21.06ms

rhaarm commented 7 years ago

I also discovered that this doesn't support Python 3.5 in general when the JSON packet for the options is passed back to the api from the frontend. I had to run this under Python 2.7 in order to get the scheduler to run and accept new job tasks.

Traceback (most recent call last): File "/usr/local/lib/python3.5/site-packages/tornado/web.py", line 1422, in _execute result = self.prepare() File "/src/ndscheduler/ndscheduler/server/handlers/base.py", line 25, in prepare self.json_args = json.loads(self.request.body) File "/usr/local/lib/python3.5/json/init.py", line 312, in loads s.class.name)) TypeError: the JSON object must be str, not 'bytes' 2017-05-08 15:23:44,343 - tornado.access - ERROR - 500 POST /api/v1/jobs (172.17.0.1) 15.47ms

wenbinf commented 7 years ago

Should all be fixed in https://github.com/Nextdoor/ndscheduler/pull/16