cgohlke / molmass

Molecular mass calculations
https://pypi.org/project/molmass
BSD 3-Clause "New" or "Revised" License
56 stars 13 forks source link

molmass_web #9

Closed liquidcarbon closed 3 years ago

liquidcarbon commented 3 years ago

On WSL2 with anaconda:

python molmass/molmass/molmass_web.py
Serving CGI script at http://localhost:9000/molmass_web.py
127.0.0.1 - - [17/Jun/2021 15:44:53] "GET /molmass_web.py HTTP/1.1" 200 -
----------------------------------------
Exception happened during processing of request from ('127.0.0.1', 35298)
Traceback (most recent call last):
  File "/a/lib/python3.8/http/server.py", line 1179, in run_cgi
    os.execve(scriptfile, args, env)
OSError: [Errno 8] Exec format error: '~/molmass/molmass/molmass_web.py'
----------------------------------------
127.0.0.1 - - [17/Jun/2021 15:44:53] CGI script exit status 0x7f00
cgohlke commented 3 years ago

Good point. I think for WSL the file needs a shebang (#!/usr/bin/env python3), unix line endings, and maybe execute permissions.

liquidcarbon commented 3 years ago

The shebang did it. Thanks! Not sure how to make it platform-independent :)

cgohlke commented 3 years ago

Should be fixed in v2021.6.18