karplus Posted November 4, 2023 Posted November 4, 2023 Hello, i tried to run a simple test.py as stated on this tutorial https://wiki.helionet.org/tutorials/python and this topic too: Still i get http 500 error when i open https://karplus.helioho.st/cgi-bin/test.py ; I already checked line endings and they are in unix style; plus i wrote the code by hand directly in online text editor, and also tried copy&paste, but got no luck! Permissions are 755 as suggested by tutorial. In logs section I always got this error: End of script output before headers: test.py, referer: https://johnny.heliohost.org:8443/ , but I used print("Content-Type: text/html\n\n"), and all the versions of Python supported by Johnny. Where am I wrong? Best Regards
wolstech Posted November 5, 2023 Posted November 5, 2023 The cgi-bin folder needs to be 750, not 777. I changed the permissions for you and the script is working now.
karplus Posted November 6, 2023 Author Posted November 6, 2023 Thanks, works like a charm now. It would be useful for other users to update the wiki tutorial then 😃
karplus Posted August 12 Author Posted August 12 (edited) Hello, the same problem is back after re-enabling my Johnny account, I waited 6 hours since mail of succeeded renewal. Permission of https://karplus.helioho.st/cgi-bin/test.py is 755 and cgi-bin folder is 750. Edited August 12 by karplus
wolstech Posted August 12 Posted August 12 Python versions have changed on the new Johnny. If it was using 3.10 you probably need to update your shebang lines to use 3.12 or 3.9 #!/usr/bin/python3.12 or #!/usr/bin/python3.9
karplus Posted August 13 Author Posted August 13 Hello, i did some tests using my scripts that were fully working before the last july johnny raid crash, and i found that these python modules are now missing: python3.12: pandas, bs4/beautifulsoup4, python-dateutil python3.9: pandas, bs4/beautifulsoup4, requests, pytz It's possible in the longtime to restore them? Thanks you!
Krydos Posted August 14 Posted August 14 On 8/13/2024 at 5:14 AM, karplus said: python3.12: pandas, bs4/beautifulsoup4, python-dateutil Installed. You can see the list of installed modules on Johnny's Python 3.12 and their current versions at https://krydos2.heliohost.org/pyinfo/info3.12.py On 8/13/2024 at 5:14 AM, karplus said: python3.9: pandas, bs4/beautifulsoup4, requests, pytz Installed. You can see the list of installed modules on Johnny's Python 3.9 and their current versions at https://krydos2.heliohost.org/pyinfo/info3.9.py
karplus Posted August 14 Author Posted August 14 Hello, thanks for everything, I confirm that all required modules get correctly imported now. Now have one last standing error, I report this to you only as a "warning", not a requirement.In the previous johnny installation i used this line of code: locale.setlocale(category=locale.LC_ALL,locale='it_IT.utf8') But now it returns this error: File "/usr/lib64/python3.9/locale.py", line 610, in setlocale return _setlocale(category, locale) locale.Error: unsupported locale setting Maybe underlying operating system is involved.
Krydos Posted August 14 Posted August 14 AlmaLinux 9 doesn't come with Italian installed by default. Try the code now that it's been installed.
Recommended Posts