[2.6.4] python2.2 fails to compile zope stuff
hello, The last debian upgrade broke because it starts the following command every upgrade and this time it crashed: python2.2 -O /usr/lib/python2.2/compileall.py -q /usr/lib/zope It gives thousands of errors, mainly "SyntaxError: 'return' outside function", but also others: [...] SyntaxError: 'return' outside function File "/usr/lib/zope/lib/python/Products/SilvaDocument/widgets/util/get_title_text.py", line 14 return editorsupport.render_heading_as_html(child) SyntaxError: 'return' outside function File "/usr/lib/zope/lib/python/Products/SilvaDocument/widgets/util/render_dlist.py", line 22 return content SyntaxError: 'return' outside function File "/usr/lib/zope/lib/python/Products/SilvaDocument/widgets/util/render_list.py", line 33 return '<%s class="%s">\n%s</%s>' % ( SyntaxError: 'return' outside function Sorry: TypeError: compile() argument 1 must be string without null bytes, not str Sorry: TypeError: compile() argument 1 must be string without null bytes, not str any suggestions how to debug/fix it? bye jonas
Jonas Meurer wrote at 2004-5-14 17:58 +0200:
hello, The last debian upgrade broke because it starts the following command every upgrade and this time it crashed: python2.2 -O /usr/lib/python2.2/compileall.py -q /usr/lib/zope
It gives thousands of errors, mainly "SyntaxError: 'return' outside function", but also others:
[...] SyntaxError: 'return' outside function
It entered a directory with "FSPythonScripts". An "FSPythonScript" is like a Python function but without the "def header". Therefore, Python finds "return"s outside of a function. Do not try to compile "FSPythonScripts". This is useless (and will not work, as you already found out). -- Dieter
On 14/05/2004 Dieter Maurer wrote:
[...] SyntaxError: 'return' outside function
It entered a directory with "FSPythonScripts".
An "FSPythonScript" is like a Python function but without the "def header". Therefore, Python finds "return"s outside of a function.
Do not try to compile "FSPythonScripts". This is useless (and will not work, as you already found out).
mh, so the line in zope.postinst is wrong? It's wrong to compile the whole /usr/lib/zope directory? Is there a way to exclude "FSPythonScripts"? bye jonas
Jonas Meurer wrote at 2004-5-14 22:32 +0200:
... mh, so the line in zope.postinst is wrong? It's wrong to compile the whole /usr/lib/zope directory? Is there a way to exclude "FSPythonScripts"?
I patched the installation process not to enter "skins" directory (where "FSPythonScripts" usually live). That is only an heuristic, however. There is no (easy) way to exclude just "FSPythinScripts" (as on the file system, they look just like normal Python sources). -- Dieter
Avoid installing add-on products (like Silva) into the Zope trunk. Use instance homes for your own applications. Stefan On Freitag, Mai 14, 2004, at 17:58 Europe/Vienna, Jonas Meurer wrote:
any suggestions how to debug/fix it?
-- The time has come to start talking about whether the emperor is as well dressed as we are supposed to think he is. /Pete McBreen/
participants (3)
-
Dieter Maurer -
Jonas Meurer -
Stefan H. Holek