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: https://foss.heptapod.net/pypy/pypy/-/issues/3606
|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|
John, The pypy' program is new to me. The description on https://foss.heptapod.net/pypy/pypy 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: https://docs.python.org/3/library/symtable.html. Tom Ekberg Senior Computer Specialist Department of Laboratory Medicine and Pathology 4th Floor, Pat Steel Building, currently WFH Home: (253) 561-2509 Email: email@example.com
|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 symtable.py 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: https://issues.roundup-tracker.org/issue2551026
|msg7391||Author: [hidden] (rouilj)||Date: 2021-12-01 17:42|
I ran https://issues.roundup-tracker.org/file1708/python_bug.py 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 "successfully".
|2021-12-01 17:42:53||rouilj||set||messages: + msg7391|
|2021-12-01 16:33:36||tekberg||set||messages: + msg7390|
|2021-11-30 23:53:39||rouilj||set||messages: + msg7388|
|2021-11-30 22:55:31||tekberg||set||messages: + msg7387|
messages: + msg7386