[issue23063] `python setup.py check --restructuredtext --strict --metadata` fails with: `warning: check: Could not finish the parsing.` if the RST document uses code or code-block directives.

2016-12-15 Thread Matt Bogosian

Changes by Matt Bogosian :


--
nosy: +posita

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23063] `python setup.py check --restructuredtext --strict --metadata` fails with: `warning: check: Could not finish the parsing.` if the RST document uses code or code-block directives.

2015-01-14 Thread Roundup Robot

Roundup Robot added the comment:

New changeset db09d760b965 by Benjamin Peterson in branch '3.4':
fix parsing reST with code or code-block directives (closes #23063)
https://hg.python.org/cpython/rev/db09d760b965

New changeset 38826e21f0db by Benjamin Peterson in branch '2.7':
fix parsing reST with code or code-block directives (closes #23063)
https://hg.python.org/cpython/rev/38826e21f0db

New changeset 731a36c13629 by Benjamin Peterson in branch 'default':
merge 3.4 (#23063)
https://hg.python.org/cpython/rev/731a36c13629

--
nosy: +python-dev
resolution:  - fixed
stage: commit review - resolved
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23063
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23063] `python setup.py check --restructuredtext --strict --metadata` fails with: `warning: check: Could not finish the parsing.` if the RST document uses code or code-block directives.

2014-12-19 Thread Éric Araujo

Éric Araujo added the comment:

An active core developer needs to see this and decide to commit the patch.  You 
can see if there’s someone on IRC.  If there’s no action in a week or two, feel 
free to ask on python-dev (maybe listing more than one waiting patch, or 
offering reviews in exchange for core dev time).

--
stage: patch review - commit review

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23063
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23063] `python setup.py check --restructuredtext --strict --metadata` fails with: `warning: check: Could not finish the parsing.` if the RST document uses code or code-block directives.

2014-12-16 Thread Marc Abramowitz

Marc Abramowitz added the comment:

Testing a few common cases:

$ python setup.py check --restructuredtext --strict --metadata
running check
error: The docutils package is needed.

$ python setup.py check --restructuredtext --strict --metadata
running check
warning: check: Cannot analyze code. Pygments package not found. (line 66)

warning: check: Cannot analyze code. Pygments package not found. (line 99)

error: Please correct your package.

$ python setup.py check --restructuredtext --strict --metadata  echo RST was 
OK.
running check
RST was OK.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23063
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23063] `python setup.py check --restructuredtext --strict --metadata` fails with: `warning: check: Could not finish the parsing.` if the RST document uses code or code-block directives.

2014-12-16 Thread Marc Abramowitz

Marc Abramowitz added the comment:

Note that this patch does 2 things:

1. Improves the error message
2. Prevents check from failing when there are code-blocks

If I only did #1 and not #2, then output looks like this:

$ python setup.py check --restructuredtext --strict --metadata  echo RST was 
OK.
running check
warning: check: Could not finish the parsing: 'Values' object has no attribute 
'syntax_highlight'.

error: Please correct your package.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23063
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23063] `python setup.py check --restructuredtext --strict --metadata` fails with: `warning: check: Could not finish the parsing.` if the RST document uses code or code-block directives.

2014-12-16 Thread Berker Peksag

Changes by Berker Peksag berker.pek...@gmail.com:


--
keywords: +patch
Added file: http://bugs.python.org/file37464/cfabe07bc98f.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23063
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23063] `python setup.py check --restructuredtext --strict --metadata` fails with: `warning: check: Could not finish the parsing.` if the RST document uses code or code-block directives.

2014-12-16 Thread Berker Peksag

Changes by Berker Peksag berker.pek...@gmail.com:


--
stage:  - patch review
versions:  -Python 3.2, Python 3.3, Python 3.6

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23063
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23063] `python setup.py check --restructuredtext --strict --metadata` fails with: `warning: check: Could not finish the parsing.` if the RST document uses code or code-block directives.

2014-12-16 Thread Berker Peksag

Berker Peksag added the comment:

Could you add a test? See Lib/distutils/tests/test_check.py.

--
nosy: +berker.peksag

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23063
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23063] `python setup.py check --restructuredtext --strict --metadata` fails with: `warning: check: Could not finish the parsing.` if the RST document uses code or code-block directives.

2014-12-16 Thread Marc Abramowitz

Marc Abramowitz added the comment:

OK, I added a test.

See:

* 
https://bitbucket.org/msabramo/cpython/commits/9b8f6812ff6981b5f195b6bf73cefb0fea46fba6
* 
https://bitbucket.org/msabramo/cpython/pull-request/1/fix-distutils-setuppy-check/diff

If you want, I can also update the diff attached here, but maybe it's easier to 
just look at my branch on Bitbucket? Whatever is most convenient for you...

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23063
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23063] `python setup.py check --restructuredtext --strict --metadata` fails with: `warning: check: Could not finish the parsing.` if the RST document uses code or code-block directives.

2014-12-16 Thread Éric Araujo

Changes by Éric Araujo mer...@netwok.org:


--
hgrepos: +288

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23063
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23063] `python setup.py check --restructuredtext --strict --metadata` fails with: `warning: check: Could not finish the parsing.` if the RST document uses code or code-block directives.

2014-12-16 Thread Éric Araujo

Changes by Éric Araujo mer...@netwok.org:


Added file: http://bugs.python.org/file37471/9b8f6812ff69.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23063
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23063] `python setup.py check --restructuredtext --strict --metadata` fails with: `warning: check: Could not finish the parsing.` if the RST document uses code or code-block directives.

2014-12-16 Thread Éric Araujo

Changes by Éric Araujo mer...@netwok.org:


--
hgrepos:  -286

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23063
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23063] `python setup.py check --restructuredtext --strict --metadata` fails with: `warning: check: Could not finish the parsing.` if the RST document uses code or code-block directives.

2014-12-16 Thread Marc Abramowitz

Changes by Marc Abramowitz msabr...@gmail.com:


Added file: http://bugs.python.org/file37472/issue23063.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23063
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23063] `python setup.py check --restructuredtext --strict --metadata` fails with: `warning: check: Could not finish the parsing.` if the RST document uses code or code-block directives.

2014-12-16 Thread Éric Araujo

Éric Araujo added the comment:

The Mercurial integration lets you update the patch with one click.  
Decentralized VCSes are nice :‑)

Patch looks good to me.  Thank you.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23063
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23063] `python setup.py check --restructuredtext --strict --metadata` fails with: `warning: check: Could not finish the parsing.` if the RST document uses code or code-block directives.

2014-12-16 Thread Marc Abramowitz

Marc Abramowitz added the comment:

What's the next step?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23063
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23063] `python setup.py check --restructuredtext --strict --metadata` fails with: `warning: check: Could not finish the parsing.` if the RST document uses code or code-block directives.

2014-12-15 Thread Marc Abramowitz

New submission from Marc Abramowitz:

`python setup.py check --restructuredtext --strict --metadata` fails with:

warning: check: Could not finish the parsing.

if the RST document uses `code` or `code-block` directives.

This is annoying because the document is valid, but it appears to be invalid
and confuses people. For example, see
https://github.com/ionelmc/pytest-benchmark/pull/4#issuecomment-66940307

How to reproduce this bug
-

Clone a repo that has a `README.rst` with `code-block` directives in it. E.g.:

$ git clone g...@github.com:ionelmc/pytest-benchmark.git
$ cd pytest-benchmark
$ git checkout ab0b08f6fccb06a7909905a8409f8faa8b01e0d8

   Observe that it has code-blocks in it:

   $ grep 'code-block' README.rst
   .. code-block:: python
   .. code-block:: python

Observe that RST document is valid, according to `rst2html.py`:

   $ rst2html.py --halt=1 README.rst  README.html  echo RST was OK.
   RST was OK.

   $ head -n 3 README.html
   ?xml version=1.0 encoding=utf-8 ?
   !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN 
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;
   html xmlns=http://www.w3.org/1999/xhtml; xml:lang=en lang=en

Observe that `python setup.py check --restructuredtext --strict --metadata` 
fails:

$ python setup.py check --restructuredtext --strict --metadata
running check
warning: check: Could not finish the parsing.

error: Please correct your package.

$ echo $?
1

**What was expected**: `python setup.py check --restructuredtext --strict
--metadata` should succeed with no warnings, just as `rst2html.py did`, because
`README.rst` is a valid RST document.

**What actually happened**: `python setup.py check --restructuredtext --strict
--metadata` prints a warning and an error and fails, unlike `rst2html.py`

The error is coming from here:
https://github.com/python/cpython/blob/master/Lib/distutils/command/check.py#L142

It's happening because of this line:
https://github.com/python/cpython/blob/master/Lib/distutils/command/check.py#L125

:::python
settings = frontend.OptionParser().get_default_values()

If this is changed to:

:::python
settings = frontend.OptionParser(components=(Parser,)).get_default_values()

then things work much better (this is how `tools/quicktest.py` in docutils does 
it for example -- see 
https://sourceforge.net/p/docutils/code/HEAD/tree/trunk/docutils/tools/quicktest.py#l196)

The attached patch prevents the failure from happening and also adds more 
information to the error when things go south.

--
components: Distutils
hgrepos: 286
messages: 232720
nosy: Marc.Abramowitz, dstufft, eric.araujo
priority: normal
severity: normal
status: open
title: `python setup.py check --restructuredtext --strict --metadata` fails 
with: `warning: check: Could not finish the parsing.` if the RST document uses 
code or code-block directives.
type: behavior
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23063
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com