matthewwall / weewx-as3935

weewx service that collects data from as3935 lightning detector
GNU General Public License v3.0
4 stars 3 forks source link

Not working for WeeWx 4.0 #1

Closed RayZorb closed 10 months ago

RayZorb commented 4 years ago

May 31 19:15:32 WeatherPI systemd[1]: Started LSB: weewx weather system. May 31 19:15:32 WeatherPI weewx[9774] CRITICAL main: Caught unrecoverable exception: May 31 19:15:32 WeatherPI weewx[9774] CRITICAL main: invalid syntax (as3935.py, line 233) May 31 19:15:32 WeatherPI weewx[9774] CRITICAL main: Traceback (most recent call last): May 31 19:15:32 WeatherPI weewx[9774] CRITICAL main: File "/home/weewx/bin/weewxd", line 148, in main May 31 19:15:32 WeatherPI weewx[9774] CRITICAL main: engine = weewx.engine.StdEngine(config_dict) May 31 19:15:32 WeatherPI weewx[9774] CRITICAL main: File "/home/weewx/bin/weewx/engine.py", line 75, in init May 31 19:15:32 WeatherPI weewx[9774] CRITICAL main: self.loadServices(config_dict) May 31 19:15:32 WeatherPI weewx[9774] CRITICAL main: File "/home/weewx/bin/weewx/engine.py", line 138, in loadServices May 31 19:15:32 WeatherPI weewx[9774] CRITICAL main: obj = weeutil.weeutil.get_object(svc)(self,config_dict) May 31 19:15:32 WeatherPI weewx[9774] CRITICAL main: File "/home/weewx/bin/weeutil/weeutil.py", line 1093, in get_object May 31 19:15:32 WeatherPI weewx[9774] CRITICAL main: mod = import(module) May 31 19:15:32 WeatherPI weewx[9774] CRITICAL main: File "/home/weewx/bin/user/as3935.py", line 233 May 31 19:15:32 WeatherPI weewx[9774] CRITICAL main: except Exception, e: May 31 19:15:32 WeatherPI weewx[9774] CRITICAL main: ^ May 31 19:15:32 WeatherPI weewx[9774] CRITICAL main: SyntaxError: invalid syntax May 31 19:15:32 WeatherPI weewx[9774] CRITICAL main: **** Exiting.

ebonzl commented 3 years ago

Seems to be a Python 3 compatibility issue, would be great if this was working again

m5djc commented 2 years ago

I know that this thread has been open for some time but this is what I have found out. Apparently in python3 'raise syntax no longer accepts comma-separated arguments' I think it may have been left in older versions of Python for backward compatibility. I am using Python 3.10 and changed line 233 to except Exception as e: which resolved the issue (I think!) I am not familiar with GIt HUB and forks etc. So I thought I would mention it here. Hopefully the author will update the Master.

roe-dl commented 10 months ago

See PR #2

matthewwall commented 10 months ago

thank you roe-dl and m5djc. fix is now on master and tagged as v0.7. beware that this also changes the name of the fields so that they match the lightning observations in the wview_extended schema. anyone already using the extension will have to change the code or change the column names in the database. apologies for not having a backward-compatible implementation.