Bug#1038883: dolfin: autopkgtest failure due to bytes as docstring
Gregor Riepl
onitake at gmail.com
Mon Jun 26 07:42:05 BST 2023
> your package fails the autopkgtest with the new pytest 7.3 because
> python/test/unit/function/test_function_space.py uses a bytes object
> (b""" literal) as module docstring, and pytest crashes while looking for
> the "PYTEST_DONT_REWRITE" marker.
This does sound like a serious bug in pytest, though. If it can't
process the docstring, it should ignore it, not crash.
But I don't quite get why it would choke on a byte string, if it's just
looking for a token?
> As far as I understand, using a bytes() object as docstring violates
> PEP-257, which is why I am filing this as a dolfin bug and not a pytest
> regression. I have Cc'd the debian-python mailing list for a second
> opinion, but I believe this bug should be resolved by getting rid of the
> erroneous "b" prefix.
PEP-257 says:
> If you violate these conventions, the worst you’ll get is some dirty
> looks. But some software (such as the Docutils docstring processing
> system PEP 256, PEP 258) will be aware of the conventions, so
> following them will get you the best results.
FWIW, I think this should be fixed in both pytest and the affected
package. Unless there is a specific reason for the byte string, it
should be replaced with a regular string.
More information about the debian-science-maintainers
mailing list