[New-bugs-announce] [issue31292] `python setup.py check --restructuredtext` fails when a include directive is present.

flying sheep report at bugs.python.org
Mon Aug 28 09:57:45 EDT 2017


New submission from flying sheep:

If I have a setup.py containing a include directive, and use the command in the title, I get


Traceback (most recent call last):
  [...]
  File "/usr/lib/python3.6/site-packages/docutils/parsers/rst/directives/misc.py", line 59, in run
    source_dir = os.path.dirname(os.path.abspath(source))
  File "/usr/lib/python3.6/posixpath.py", line 369, in abspath
    path = os.fspath(path)
TypeError: expected str, bytes or os.PathLike object, not _io.StringIO


The bug is in this method: distutils.command.check.check._check_rst_data

The first line already hints at it: `source_path = StringIO()`

StringIO instances aren’t paths, but at least the include directive (docutils.parsers.rst.directives.misc.Include) expects one.

----------
components: Distutils
files: check-test.py
messages: 300953
nosy: dstufft, flying sheep, merwok
priority: normal
severity: normal
status: open
title: `python setup.py check --restructuredtext` fails when a include directive is present.
type: crash
versions: Python 3.5, Python 3.6, Python 3.7
Added file: http://bugs.python.org/file47104/check-test.py

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue31292>
_______________________________________


More information about the New-bugs-announce mailing list