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

Regression: csv-table with file option is broken if used in included file in sphinx 1.8.1. #5495

Closed
ociule opened this issue Sep 27, 2018 · 3 comments
Labels
Milestone

Comments

@ociule
Copy link

ociule commented Sep 27, 2018

Subject: csv-table with file option is now broken if used in an included file

Problem

  • index.rst includes a test_table_csv_file.rst
  • test_table_csv_file.rst has a csv-file directive with a file option
    On sphinx 1.7.x, this works fine
    On sphinx 1.8.1, this generates the following error:
test_csv_table_file.rst <included from C:\Users\ociule\work\sphinx_test\index.rst>:4: WARNING: Problems with "csv-table" directive path:

[Errno 22] Invalid argument: 'test_csv_table_file.rst <included from C:/Users/ociule/work/sphinx_test/test.csv'.

.. csv-table::
  :file: test.csv

Procedure to reproduce the problem

Start a new sphinx project.

Add this is index.rst:

.. include:: test_csv_table_file.rst

Create test_csv_table_file.rst:


.. csv-table::
  :file: test.csv

Create test.csv with whatever valid csv content, for example:

a,b
1,2

Error logs / results

test_csv_table_file.rst <included from C:\Users\ociule\work\sphinx_test\index.rst>:4: WARNING: Problems with "csv-table" directive path:

[Errno 22] Invalid argument: 'test_csv_table_file.rst <included from C:/Users/ociule/work/sphinx_test/test.csv'.

.. csv-table::
  :file: test.csv

Expected results

In sphinx 1.7.x, this works fine, and includes the csv data as expected into the generated table.

In docutils, testing with rst2html.py index.rst > index.html, this also works fine, proving it's not a docutils bug.

I suspect whatever recent changes were made to the code that parses the file path before passing it to docutils.

Reproducible project / your project

sphinx_test.zip

Environment info

  • OS: Win 7
  • Python version: 3.7
  • Sphinx version: 1.8.1
@tk0miya tk0miya added this to the 1.8.2 milestone Sep 29, 2018
@tk0miya
Copy link
Member

tk0miya commented Oct 12, 2018

Note: This bug comes from #4821

tk0miya added a commit to tk0miya/sphinx that referenced this issue Oct 14, 2018
tk0miya added a commit to tk0miya/sphinx that referenced this issue Oct 14, 2018
tk0miya added a commit that referenced this issue Oct 14, 2018
Fix #5495: csv-table directive with file option in included file is broken
@tk0miya
Copy link
Member

tk0miya commented Oct 14, 2018

Fixed by #5530.
Thank you for reporting.

@tk0miya tk0miya closed this as completed Oct 14, 2018
@iugo
Copy link

iugo commented Oct 16, 2018

sphinx 1.8.0, same problem

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants