[New-bugs-announce] [issue45920] make doctest fails

Arthur Milchior report at bugs.python.org
Sun Nov 28 17:59:43 EST 2021


New submission from Arthur Milchior <arthur at milchior.fr>:

On current main,  f87ea0350286837e9e96de03f8bfa215176c2928 , 
```
cd cpython/Doc
make doctest
```
fails. 

Due to:

Document: library/functions
---------------------------

Warning, treated as error:
**********************************************************************
File "library/functions.rst", line ?, in default
Failed example:
    list(zip(range(3), ['fee', 'fi', 'fo', 'fum'], strict=True))
Expected:
    Traceback (most recent call last):
      ...
    ValueError: zip() argument 2 is longer than argument 1
Got:
    Traceback (most recent call last):
      File "/usr/lib/python3.8/doctest.py", line 1336, in __run
        exec(compile(example.source, filename, "single",
      File "<doctest default[0]>", line 1, in <module>
        list(zip(range(3), ['fee', 'fi', 'fo', 'fum'], strict=True))
    TypeError: zip() takes no keyword arguments



This is not surprising since zip didn't take "Strict" kwarg in 3.8. The issue is that 3.10 doc is tested with Python 3.8.


If in Makefile I change Python to "Python3.10" I get a new error, but it still mention "/usr/lib/python3.8/doctest.py" so I guess for some reason it was not using 3.10 everywhere. 
I don't know make enough to have any idea how to correct this one.



By the way, is there a tool to auto-format .rst file? Initially, that was what I was trying to figure out, if I could get automatically warning when a new line is more than 80 chars long for example.

----------
assignee: docs at python
components: Documentation
messages: 407238
nosy: Arthur-Milchior, docs at python
priority: normal
severity: normal
status: open
title: make doctest fails
versions: Python 3.10

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45920>
_______________________________________


More information about the New-bugs-announce mailing list