Roundup Tracker - Issues

Issue 2551174

Run roundup on pypy interpreter
Type: compile error Severity: normal
Components: Web interface Versions:
Status: new
: : rouilj, tekberg
Priority: :

Created on 2021-11-30 21:41 by rouilj, last changed 2021-12-01 17:42 by rouilj.

msg7385 Author: [hidden] (rouilj) Date: 2021-11-30 21:41
This is a blocker for deployment to using pypy. It crashes importing symtable
which looks like it's used for processing python code in Zope Page Templates.
Opened ticket with pypy at:
msg7386 Author: [hidden] (tekberg) Date: 2021-11-30 22:37
This is code I wrote. Python2 was able to determine what symbols were 
referenced in a zope python expression. Python3 needed a more complex 
approach. For python3 using the python2 approach didn't determine all of 
the symbols in a zope python expression. It broke one of our trackers and 
had to be fixed. Not sure why pypy3 has trouble with 'import symtable'.

If someone else has a way for python3 to determine which symbols are 
referenced in a zope python expression that should be examined.
msg7387 Author: [hidden] (tekberg) Date: 2021-11-30 22:55

The pypy' program is new to me. The description on says 'PyPy is a very fast and compliant implementation of the Python language.' It sounds like this is a reimplementation of python, not the one that most people use (just python or python3). This may not be a bug in roundup, but a bug in pypy. I installed pypy3 and was able to verify the error with this command: pypy3 -c 'import symtable'. It seems to me if one can't import symtable then that means that pypy3 isn't really a complete implementation of python. Perhaps the consensus was that nobody uses that module. You can see the documentation for the module here:

Tom Ekberg
Senior Computer Specialist
Department of Laboratory Medicine and Pathology
4th Floor, Pat Steel Building, currently WFH
Home: (253) 561-2509
msg7388 Author: [hidden] (rouilj) Date: 2021-11-30 23:53
Hi Tom:

Ahh I thought that was part of the original Zope code. Thanks for correcting me.

Yes, there are a few different python implementations. 
CPython is what most of us use. PyPy and MicroPython are two native
implementations, then there is jython (python written in java)
and a couple of others.

PyPy uses just in time compilation to speed things up. Guido (the former Python BDFL)
is looking at that for speeding up CPython.

PyPy provides the whole python standard library. It looks like imports 
_symtable. IIUC _symtable is written in C in the CPython core/binary/interpreter.
So PyPy needs to implement their own version.

I may try the python2 code under PyPy to see if it works. If so I can special
case the code based on whether symtable imports correctly. However I suspect the
python2 version won't work but who knows.

Thanks for the additional info.
msg7390 Author: [hidden] (tekberg) Date: 2021-12-01 16:33
You can read more regarding this topic in this issue:
msg7391 Author: [hidden] (rouilj) Date: 2021-12-01 17:42
I ran with pypy3.
It returned the truncated list which exhibits the bug in the prior
way of accessing symbols. So looks like we need symtable to make this work.

I have to admit I have no idea how that test case works, but it is failing
Date User Action Args
2021-12-01 17:42:53rouiljsetmessages: + msg7391
2021-12-01 16:33:36tekbergsetmessages: + msg7390
2021-11-30 23:53:39rouiljsetmessages: + msg7388
2021-11-30 22:55:31tekbergsetmessages: + msg7387
2021-11-30 22:37:04tekbergsetnosy: + tekberg
messages: + msg7386
2021-11-30 21:41:47rouiljcreate