Immediately after releasing 0.13.1, formerly passing builds of dropbox/stone started failing on Travis CI:
The error message is missing/non-descript:
$ python setup.py check -m -r -s -v
warning: check: Could not finish the parsing.
error: Please correct your package.
Note that pinning docutils==0.12.0 fixes the error. (In other words, this only started showing up with 0.13.1.)
Unfortunately, I cannot reproduce this locally in OS X (I have Python 2.7.10 and Python 3.5.2), so it may be limited to certain versions of Python or certain environments.
I'm happy to assist with additional testing if needed/desired.
Back-reference to original discovery/discussion: https://github.com/dropbox/stone/pull/28#discussion-diff-91844629L44
I did not see the error description in your git log ?
Did i overlook something ?
Am 13.12.2016 01:59 schrieb "Matt Bogosian" mbogosian@users.sf.net:
Related
Bugs:
#302If you're referring to the log of the failing Travis CI build, then the only output is:
There is no detailed error message. My apologies if this was unclear from the original post or if I've misunderstood your question.
Last edit: Matt Bogosian 2016-12-14
Note: this appears to happen in the Travis CI environment with
docutils==0.13.1, even withsetup(…, license='', …, long_description='', …). In other words, I don't think it's a reStructuredText parsing problem.In this case, it is a Doctuils rst-parser setup problem. Distutils' check() function misses to pass default options, the option "use_character_level_inline_markup" is tested during the initialization of the parser.
Thank you for your report. We are sorry for the inconvenience but without error message, we can only guess.
It seems the problem is an incompatibility between docutils 0.13 and the application running it. A similar problem was detected and solved with the Sphinx documentation builder (see Bugs: #301).
In case dropbox/stone/travis uses Docutils via Sphinx, the issue may be solved by upgrading to Sphinx 1.5.1.
Our project doesn't use Sphinx. Are you saying that
docutils0.13 is not backward-compatible with 0.12? That is the only difference between our passing and failing builds.What I say is that Docutils 0.13 is incompatible with Sphinx < 5.1.5 and possibly incopatible with your application or some middleware at Travis.
Docutils 0.13.1 is backward-compatible to 0.12 in the sense that all
documented features are kept and the all tests pass. There is no change to
the rST format.
However, depending on the way Docutils is used, internal changes can lead to incompatibilities (or make existing incompatibilities lead to crashes/failure).
This cannot be solved without better knowledge about the actual way your
project uses Docutils.
Using Docutils via the provided front-ends results in error messages we can
interpret. With just a vague "Could not finish the parsing. Correct your package" we are left to wild guesses. My first guess (Sphinx) was wrong, so the following questings may lead to a better guess:
Okay, this is about as simple as I can get things, and I can still repro the problem:
https://github.com/posita/stone/tree/posita/repro-docutils-snafu
That has a single (empty) package (a zero-byte
stone/__init__.py), and about as simple asetup.pyas one can get. The only dependency (pulled in fromtox) isdocutils. As you can see from the builds,docutils==0.12succeeds,docutils=0.13.1fails, with the exception of Python 3.5:https://travis-ci.org/dropbox/stone/builds/183778095
Back-reference: https://github.com/travis-ci/travis-ci/issues/7028
The error is happening here:
See also: https://github.com/travis-ci/travis-ci/issues/7028#issuecomment-266940801
Last edit: Matt Bogosian 2016-12-14
Please save the following as a script, add it to your tox.ini as a command in each environment, and reply with the results:
This isolates what I believe will indicate the root problem. The settings object is lacking an attribute, causing the error. Why is still a mystery, which hopefully the results of the above will help clarify.
Thanks!
Thank you for looking into this and giving more input.
On 14.12.16, Matt Bogosian wrote:
This helps a lot to solve the mystery:
The character_level_inline_markup setting is new in 0.13:
docutils/parsers/
-- HISTORY.txt
It is set in parsers/rst/init.py::
and used in parsers/rst/states.py::
The latter seems to be the problematic spot:
settingscould be theValues instancethat "has no attribute 'character_level_inline_markup'".This does not (yet) solve the mystery, why this is a problem in your use
case but not in our tests. Maybe some middleware is passing settings as a
dictionary or similar.
Anyway, you may try the following patch that ensures the new setting is
present with its default (backwards compatible) value:
Exec: svn 'diff' 'states.py' 2>&1
Dir: /home/milde/Code/Python/docutils-svn/docutils/docutils/parsers/rst/
Index: states.py
--- states.py (Revision 7996)
+++ states.py (Arbeitskopie)
@@ -467,7 +467,7 @@
start_string_prefix = u'(^|(?<!\x00))'
end_string_suffix = u''
else:
As an aside, this (from
distutils/command/check.py) probably risks hiding a lot of errors like the above:Last edit: Matt Bogosian 2016-12-14
Matt, thanks for the investigation. But please don't mischaracterize: "UPDATE: docutils maintainers do not appear interested in helping without additional information from our end. They are blaming it on our application." (https://github.com/dropbox/stone/pull/28#discussion_r92260654) That is false, and doesn't help.
Nobody blamed anyone; we're just mystified as to what's going on and need more information to investigate.
The replies above look very helpful though. Thanks!
Corrected with my sincere apologies. 😔
Last edit: Matt Bogosian 2016-12-14
Searching my email for "finish the parsing", I found something possibly related: https://sourceforge.net/p/docutils/bugs/270/
I found that as well, but we are able to reproduce with empty strings passed to
long_description(see oursetup.py) and without any code blocks whatsoever, which led me to believe it was a different issue?It looks very much like a reoccurence of the generic problem - in #270: the way "distutils" calls and uses Docutils in its check() function.
The Python issue (and patch) http://bugs.python.org/issue23063
could explain, why in your case setup.py check() works with
Docutils 0.13 under Python 3.5.
Could you try whether applying marcman's Docutils-workaround
https://sourceforge.net/p/docutils/bugs/_discuss/thread/c5444752/f668/attachment/bug_270_2.patch
solves the problem with setup.py check() and Docutils 0.13 ?
I concur with Günter. It looks like the issue you're seeing is because Distutils is not setting up Docutils objects properly. This has been fixed in Python in http://bugs.python.org/issue23063. It looks like #270 was just another expression of this. I'm guessing that the Python 2.7.x in the failing environment is not up to date, and does not have the fix to the Python bug above.
So the question is, what specific version of Python is failing? Please include the micro version: 2.7.what?
My apologies for not fully understanding #270. I thought it was more specific than it actually was. Travis CI appears to have 2.7.9 and 3.4.2. I'll try the patch and report back.
Yup, Python 2.7.9 and 3.4.2 are the proximal reason. The Python bugfix was applied to 2.7.10 and 3.4.3. Any chance of updating the Python versions (currently 2.7.12 and 3.4.5) on the system running Travis CI? That ought to solve it without resorting to ugly workarounds.
Here is the output of the requested debug
pprintscript:https://travis-ci.org/dropbox/stone/builds/183841292
Specifically (e.g., from the Python 2.7 job):
Oddly enough,
character_level_inline_markupseems to be present (andFalse)? 😕Last edit: Matt Bogosian 2016-12-14
This is another instance of the problem in #270