module _cppyy disabled in py3.5 release?
Hi, in the release-pypy3.5-v6.0.0 branch (and hence in the 3.5 release), module _cppyy was disabled: "_csv", "_pypyjson", "_posixsubprocess", # "_cppyy", "micronumpy" The commit history doesn't say? Anything I should fix? Thanks! Best regards, Wim -- WLavrijsen@lbl.gov -- +1 (510) 486 6411 -- www.lavrijsen.net
On 03/05/18 12:42, Matti Picus wrote:
Hi,
in the release-pypy3.5-v6.0.0 branch (and hence in the 3.5 release), module _cppyy was disabled:
"_csv", "_pypyjson", "_posixsubprocess", # "_cppyy", "micronumpy"
The commit history doesn't say? Anything I should fix?
Thanks!
Best regards, Wim That seems to originate from 2012, commit f5eb386cd043, so I don't
On 03/05/18 08:13, wlavrijsen@lbl.gov wrote: think we ever tried py3k which became py3.5 with _cppyy. I will give it try now. Matti ... and it fails to translate. Anyone want to fix? Matti
Matti,
... and it fails to translate. Anyone want to fix?
thanks for trying; I have the fixes: an indentation error (which does not show up in p2.7 as there is only one branch; bytes <-> text thingy), and the removal of __cmp__ if p3. Where should I put them? They're safe to go into default, but then _cppyy should be enabled separately at some later point in py3. Thanks! Best regards, Wim -- WLavrijsen@lbl.gov -- +1 (510) 486 6411 -- www.lavrijsen.net
Matti,
Translates and runs. There are two new failing tests, http://buildbot.pypy.org/summary?branch=py3.5&category=linux64
not following the number two? I see three new failing tests: test_pydoc test_site test_app Only one prints something about _cppyy, but I don't understand why. I can't run any of the tests, however: after starting up, they pretty quickly print: test_pydoc.py::unmodified Then spin for almost 10 minutes and print: Traceback (application-level): File "/home/wlav/aditi/pypy/pypy/tool/pytest/run-script/regrverbose.py", line 4 in <module> from test import regrtest, support File "/home/wlav/aditi/pypy/lib-python/3/test/regrtest.py", line 199 in <module> from test import support File "/home/wlav/aditi/pypy/lib-python/3/test/support/__init__.py", line 16 in <module> import nntplib File "/home/wlav/aditi/pypy/lib-python/3/nntplib.py", line 69 in <module> import datetime ImportError: bad magic number in 'datetime': b'\n\xf3\r\n' FAILED Anyway, my best guess is that somehow some _cppyy code runs at startup. There should be none of that. I'll copy over the failing pydoc test from p3 to p2 and see whether I can at least run tests there. Best regards, Wim -- WLavrijsen@lbl.gov -- +1 (510) 486 6411 -- www.lavrijsen.net
Hi Wim, How are you running these CPython tests? The best way to run them is using a translated pypy-c and then something like pypy-c test_pydoc.py Cheers, Carl Friedrich On May 4, 2018 10:51:38 PM GMT+02:00, wlavrijsen@lbl.gov wrote:
Matti,
Translates and runs. There are two new failing tests, http://buildbot.pypy.org/summary?branch=py3.5&category=linux64
not following the number two? I see three new failing tests:
test_pydoc test_site test_app
Only one prints something about _cppyy, but I don't understand why.
I can't run any of the tests, however: after starting up, they pretty quickly print:
test_pydoc.py::unmodified
Then spin for almost 10 minutes and print:
Traceback (application-level): File "/home/wlav/aditi/pypy/pypy/tool/pytest/run-script/regrverbose.py", line 4 in <module> from test import regrtest, support File "/home/wlav/aditi/pypy/lib-python/3/test/regrtest.py", line 199 in <module> from test import support File "/home/wlav/aditi/pypy/lib-python/3/test/support/__init__.py", line 16 in <module> import nntplib File "/home/wlav/aditi/pypy/lib-python/3/nntplib.py", line 69 in <module> import datetime ImportError: bad magic number in 'datetime': b'\n\xf3\r\n' FAILED
Anyway, my best guess is that somehow some _cppyy code runs at startup. There should be none of that.
I'll copy over the failing pydoc test from p3 to p2 and see whether I can at least run tests there.
Best regards, Wim -- WLavrijsen@lbl.gov -- +1 (510) 486 6411 -- www.lavrijsen.net _______________________________________________ pypy-dev mailing list pypy-dev@python.org https://mail.python.org/mailman/listinfo/pypy-dev
Carl, thanks for your help!
How are you running these CPython tests?
Using the pypy/test_all.py script.
The best way to run them is using a translated pypy-c and then something like
pypy-c test_pydoc.py
That sounds like an expensive debugging cycle? At least on my machine, translation takes a long time. Of course, if an individual test takes more than 10mins, than translating is till preferable. :P But anyway, no joy. I get the exact same error: ../../../pypy/goal/pypy3-c test_pydoc.py Traceback (most recent call last): File "test_pydoc.py", line 15, in <module> import test.support File "/home/wlav/aditi/pypy/lib-python/3/test/support/__init__.py", line 16, in <module> import nntplib File "/home/wlav/aditi/pypy/lib-python/3/nntplib.py", line 69, in <module> import datetime ImportError: bad magic number in 'datetime': b'\n\xf3\r\n' For the heck of it, I threw it into bing. Turns out that it is not a pypy specific problem and wiping all .pyc files fixes it. I can now reproduce the error. The issue is that pydoc.ModuleScanner imports all builtin modules: for modname in sys.builtin_module_names: which then includes _cppyy. I'm going to make the loading of the backend deferred to the first use. That should make importing innocuous. Best regards, Wim -- WLavrijsen@lbl.gov -- +1 (510) 486 6411 -- www.lavrijsen.net
Matti, thanks for your patience. Fix is in default, so next time when default into the py3.5 brach, the error should go away. The fix is to completely defer the loading of the backend shared library to the point of first use. Thus importing _cppyy (and checking its __doc__ or running help() on it) is now safe. Best regards, Wim -- WLavrijsen@lbl.gov -- +1 (510) 486 6411 -- www.lavrijsen.net
participants (3)
-
Carl Friedrich Bolz-Tereick
-
Matti Picus
-
wlavrijsen@lbl.gov