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
--
wlavrij...@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

Reply via email to