Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python setup.py check --restructuredtext fails when a include directive is present. #75473

Closed
flying-sheep mannequin opened this issue Aug 28, 2017 · 6 comments
Closed
Labels
3.7 (EOL) end of life 3.8 only security fixes stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@flying-sheep
Copy link
Mannequin

flying-sheep mannequin commented Aug 28, 2017

BPO 31292
Nosy @merwok, @flying-sheep, @dstufft, @csabella, @miss-islington
PRs
  • bpo-31292: Fix distutils check --restructuredtext for include directives #3248
  • bpo-31292: Fixed distutils check --restructuredtext for include directives #10605
  • [3.7] bpo-31292: Fixed distutils check --restructuredtext for include directives (GH-10605) #12593
  • [2.7] bpo-31292: Fixed distutils check --restructuredtext for include directives (GH-10605) #12594
  • Files
  • check-test.py: Demo script for this issue
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2019-03-27.21:49:22.114>
    created_at = <Date 2017-08-28.13:57:45.748>
    labels = ['3.7', '3.8', 'type-bug', 'library']
    title = '`python setup.py check --restructuredtext` fails when a include directive is present.'
    updated_at = <Date 2019-03-27.22:26:00.429>
    user = 'https://github.com/flying-sheep'

    bugs.python.org fields:

    activity = <Date 2019-03-27.22:26:00.429>
    actor = 'miss-islington'
    assignee = 'none'
    closed = True
    closed_date = <Date 2019-03-27.21:49:22.114>
    closer = 'cheryl.sabella'
    components = ['Distutils']
    creation = <Date 2017-08-28.13:57:45.748>
    creator = 'flying sheep'
    dependencies = []
    files = ['47104']
    hgrepos = []
    issue_num = 31292
    keywords = ['patch']
    message_count = 6.0
    messages = ['300953', '301031', '338987', '338989', '338990', '338991']
    nosy_count = 5.0
    nosy_names = ['eric.araujo', 'flying sheep', 'dstufft', 'cheryl.sabella', 'miss-islington']
    pr_nums = ['3248', '10605', '12593', '12594']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue31292'
    versions = ['Python 2.7', 'Python 3.7', 'Python 3.8']

    @flying-sheep
    Copy link
    Mannequin Author

    flying-sheep mannequin commented Aug 28, 2017

    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.

    @flying-sheep flying-sheep mannequin added type-crash A hard crash of the interpreter, possibly with a core dump 3.7 (EOL) end of life stdlib Python modules in the Lib dir labels Aug 28, 2017
    @flying-sheep
    Copy link
    Mannequin Author

    flying-sheep mannequin commented Aug 30, 2017

    I should have linked the file: distutils/command/check.py

    @serhiy-storchaka serhiy-storchaka added type-bug An unexpected behavior, bug, or error and removed type-crash A hard crash of the interpreter, possibly with a core dump labels Jul 11, 2018
    @csabella
    Copy link
    Contributor

    New changeset d5a5a33 by Cheryl Sabella (Philipp A) in branch 'master':
    bpo-31292: Fixed distutils check --restructuredtext for include directives (GH-10605)
    d5a5a33

    @csabella
    Copy link
    Contributor

    Thanks @flying sheep for the PR and @merwok for the review!

    @csabella csabella added the 3.8 only security fixes label Mar 27, 2019
    @miss-islington
    Copy link
    Contributor

    New changeset 600aca4 by Miss Islington (bot) in branch '2.7':
    bpo-31292: Fixed distutils check --restructuredtext for include directives (GH-10605)
    600aca4

    @miss-islington
    Copy link
    Contributor

    New changeset 9cad523 by Miss Islington (bot) in branch '3.7':
    bpo-31292: Fixed distutils check --restructuredtext for include directives (GH-10605)
    9cad523

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.7 (EOL) end of life 3.8 only security fixes stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants