Zeronet: Latest update fails to run on Mac

Created on 20 Jan 2018  路  11Comments  路  Source: HelloZeroNet/ZeroNet

Step 1: Please describe your environment

  • ZeroNet version: Latest (Version: 0.6.1 r3221 I think)
  • Operating system: MacOS Sierra 10.12.6 (16G29)
  • Web browser: Irrelevant. Though I normally use Firefox Nightly
  • Tor status: Default setting
  • Opened port: Either way, both fail.
  • Special configuration: Nothing

Step 2: Describe the problem:

ZeroNet fails to start.

SyntaxError: unqualified exec is not allowed in function 'bench' it is a nested function (UiRequest.py, line 645)
bug confirmation needed

Most helpful comment

I just tested it with python 2.6.x and it works (the exec code drops the same error as you described), so I suppose it will work with 2.7.6

All 11 comments

Looking for similar errors, looks like it might be related to a bug that was fixed in Python 2.7.9. Maybe try updating it?

I'm not sure what the fix was for the config thing, but that went away eventually. The other error had an issue with this line in /src/ui/uirequest.py

 exec(init, globals(), locals())

I changed it to:

exec init in globals(), locals()

And it worked fine. Is it due to an older python version? I'll have to look into updating.

My ZeroNet on Windows is running off of Python 2.7.9(pure coincidence) and didn't encounter this. So it probably is related to that old bug I mentioned.

@April93 Weird, that exec init in globals(), locals() is Python3-style.

Here's the stackoverflow page I read on how to 'fix' the problem. No idea what's going on tbh.

PR: #1253.

I tried updating to python 2.7.14 and it works fine without the fix.

Yeah, looks like this was a bug in Python <=2.7.8, which was fixed in 2.7.9.

This answer on that Stackoverflow page you linked explains it.

Thanks for reporting. I switched to eval from exec: https://github.com/HelloZeroNet/ZeroNet/commit/0c6c7d27252f01cddbc8cc7109082f6a72afb7d7#diff-7fa31802ec08bb55f5128c3e841b5f34R645

Can you please verify if it's fixed the problem?
You have to save https://raw.githubusercontent.com/HelloZeroNet/ZeroNet/0c6c7d27252f01cddbc8cc7109082f6a72afb7d7/src/Ui/UiRequest.py to Users/Kafke/Downloads/ZeroNet-master/src/Ui directory

Unfortunately as I mentioned, I already updated my python version. I'm unsure of how to downgrade.

I just tested it with python 2.6.x and it works (the exec code drops the same error as you described), so I suppose it will work with 2.7.6

Was this page helpful?
0 / 5 - 0 ratings

Related issues

DaniellMesquita picture DaniellMesquita  路  3Comments

ghost picture ghost  路  4Comments

yurkobb picture yurkobb  路  3Comments

jerry-wolf picture jerry-wolf  路  4Comments

sergei-bondarenko picture sergei-bondarenko  路  3Comments