Serious regression in doctest in Py3.1rc1
![](https://secure.gravatar.com/avatar/8b97b5aad24c30e4a1357b38cc39aeaa.jpg?s=120&d=mm&r=g)
Hi, I can't currently file a bug report on this, but I was told by Lisandro Dalcín that there is a serious problem with the doctest module in Py3.1rc1. In Cython, we use doctests to test the compiler in that we compile a Python/Cython module with doctests into a C module and then run doctest on the imported extension module.
From the error report it seems to me that doctest is now trying to read the module itself through linecache for some reason, which horribly fails for a binary module.
Could someone please look into this? I'll open up a bug report tomorrow unless someone beats me to it. Thanks, Stefan
![](https://secure.gravatar.com/avatar/0508a883f97a7d0b6eb47288428b31a5.jpg?s=120&d=mm&r=g)
Hello, 2009/6/3 Stefan Behnel <stefan_ml@behnel.de>:
Hi,
I can't currently file a bug report on this, but I was told by Lisandro Dalcín that there is a serious problem with the doctest module in Py3.1rc1. In Cython, we use doctests to test the compiler in that we compile a Python/Cython module with doctests into a C module and then run doctest on the imported extension module.
From the error report it seems to me that doctest is now trying to read the module itself through linecache for some reason, which horribly fails for a binary module.
Could someone please look into this? I'll open up a bug report tomorrow unless someone beats me to it.
I don't have the time either, but the problem looks very similar to http://bugs.python.org/issue4050 The fix was to replace: file = inspect.getsourcefile(object) or inspect.getfile(object) was replaced with file = inspect.getsourcefile(object) -- Amaury Forgeot d'Arc
![](https://secure.gravatar.com/avatar/5f37aff3d274a0effbf20be82804d012.jpg?s=120&d=mm&r=g)
http://bugs.python.org/issue6195 (with patch) On Wed, Jun 3, 2009 at 8:26 AM, Amaury Forgeot d'Arc <amauryfa@gmail.com> wrote:
Hello,
2009/6/3 Stefan Behnel <stefan_ml@behnel.de>:
Hi,
I can't currently file a bug report on this, but I was told by Lisandro Dalcín that there is a serious problem with the doctest module in Py3.1rc1. In Cython, we use doctests to test the compiler in that we compile a Python/Cython module with doctests into a C module and then run doctest on the imported extension module.
From the error report it seems to me that doctest is now trying to read the module itself through linecache for some reason, which horribly fails for a binary module.
Could someone please look into this? I'll open up a bug report tomorrow unless someone beats me to it.
I don't have the time either, but the problem looks very similar to http://bugs.python.org/issue4050 The fix was to replace: file = inspect.getsourcefile(object) or inspect.getfile(object) was replaced with file = inspect.getsourcefile(object)
-- Amaury Forgeot d'Arc _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/dalcinl%40gmail.com
-- Lisandro Dalcín --------------- Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC) Instituto de Desarrollo Tecnológico para la Industria Química (INTEC) Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET) PTLC - Güemes 3450, (3000) Santa Fe, Argentina Tel/Fax: +54-(0)342-451.1594
participants (3)
-
Amaury Forgeot d'Arc
-
Lisandro Dalcin
-
Stefan Behnel