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

failure in doc build in -4.0 #318

Closed
idella opened this issue Apr 4, 2015 · 8 comments
Closed

failure in doc build in -4.0 #318

idella opened this issue Apr 4, 2015 · 8 comments

Comments

@idella
Copy link

idella commented Apr 4, 2015

/work/click-4.0 $ make -C docs html
make: Entering directory '/mnt/gen2/TmpDir/portage/dev-python/click-4.0/work/click-4.0/docs'
sphinx-build -b html -d _build/doctrees   . _build/html
Running Sphinx v1.3
loading pickled environment... not yet created
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 21 source files that are out of date
updating environment: 21 added, 0 changed, 0 removed
reading sources... [ 57%] options                                                                                        
Exception occurred:
  File "<docs>", line 6, in info
NameError: global name 'sys' is not defined
The full traceback has been saved in /tmp/sphinx-err-Ra4kt0.log, if you want to report the issue to the developers.
Please also report this if it was a user error, so that a better error message can be provided next time.
A bug report can be filed in the tracker at <https://github.com/sphinx-doc/sphinx/issues>. Thanks!
Makefile:40: recipe for target 'html' failed
make: *** [html] Error 1
make: Leaving directory '/mnt/gen2/TmpDir/portage/dev-python/click-4.0/work/click-4.0/docs'

I hope 25 is enough.

work/click-4.0 $ tail -20 /tmp/sphinx-err-Ra4kt0.log 
    directive_class, match, type_name, option_presets)
  File "/usr/lib64/python2.7/site-packages/docutils/parsers/rst/states.py", line 2103, in run_directive
    result = directive_instance.run()
  File "/usr/lib64/python2.7/site-packages/sphinx/domains/__init__.py", line 197, in run
    return BaseDirective.run(self)
  File "/mnt/gen2/TmpDir/portage/dev-python/click-4.0/work/click-4.0/docs/clickdoctools.py", line 245, in run
    rv = runner.run('\n'.join(self.content))
  File "/mnt/gen2/TmpDir/portage/dev-python/click-4.0/work/click-4.0/docs/clickdoctools.py", line 186, in run
    'isolated_filesystem': isolated_filesystem,
  File "<docs>", line 1, in <module>
  File "/mnt/gen2/TmpDir/portage/dev-python/click-4.0/work/click-4.0/docs/clickdoctools.py", line 175, in invoke
    **extra)
  File "/mnt/gen2/TmpDir/portage/dev-python/click-4.0/work/click-4.0/click/core.py", line 644, in main
    rv = self.invoke(ctx)
  File "/mnt/gen2/TmpDir/portage/dev-python/click-4.0/work/click-4.0/click/core.py", line 837, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/mnt/gen2/TmpDir/portage/dev-python/click-4.0/work/click-4.0/click/core.py", line 464, in invoke
    return callback(*args, **kwargs)
  File "<docs>", line 6, in info
NameError: global name 'sys' is not defined

click-4.0 $ python -V
Python 2.7.9
Do you require anything further?
If this need go to sphinx issue tracker please forward it. I more suspect a missing import of sys but it's not clear to me which file in the output.

@untitaker
Copy link
Contributor

I can't reproduce this, and your tracebacks are not pointing to any lines that reference sys either.

@idella
Copy link
Author

idella commented Apr 4, 2015

well another system does the same via chroot.
< and your tracebacks are not pointing to any lines that reference sys either.>
is mainly why i threw it to you. Didn't make sense to me either. I was hoping you could trace it.
I shall try get some others to crosstest but until then I suggest this might need passing onto sphinx upstream. To me the source of 'sys' ; File "", line 6, in info should be exceedingly obvious but instead it makes no more sense to you either. I also tried with sphinx-1.2.3 but got the same, and doc builds in other packages do fine in the system.

@untitaker
Copy link
Contributor

I don't think it makes sense at this point to pass it to the sphinx devs. As said, I can't reproduce it.

@idella
Copy link
Author

idella commented Apr 4, 2015

sure well as I said I shall try get a crosstest. Having something work perfectly in someone else's gentoo system is not an unknown occurrence.

@Arfrever
Copy link

Arfrever commented Apr 4, 2015

I can reproduce this problem (with Python 2, different exception with Python 3).

Fix:

--- docs/options.rst
+++ docs/options.rst
@@ -150,6 +150,7 @@
 .. click:example::

     import os
+    import sys

     @click.command()
     @click.option('--shout/--no-shout', default=False)

@Arfrever
Copy link

Arfrever commented Apr 4, 2015

Exception with Python 3:

$ make html
sphinx-build -b html -d _build/doctrees   . _build/html
/usr/lib64/python3.4/imp.py:32: PendingDeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
  PendingDeprecationWarning)
Running Sphinx v1.3.1
/usr/lib64/python3.4/site-packages/sphinx/util/pycompat.py:108: DeprecationWarning: 'U' mode is deprecated
  f = open(filepath, 'rbU')
loading pickled environment... not yet created
loading intersphinx inventory from http://docs.python.org/dev/objects.inv...
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 21 source files that are out of date
updating environment: 21 added, 0 changed, 0 removed
/usr/lib64/python3.4/site-packages/docutils/io.py:236: DeprecationWarning: 'U' mode is deprecated                                                            
  self.source = open(source_path, mode, **kwargs)

Exception occurred:
  File "/tmp/click-4.0/docs/clickdoctools.py", line 73, in isolation
    if isinstance(input, unicode):
NameError: name 'unicode' is not defined
The full traceback has been saved in /tmp/sphinx-err-ot5tjvjw.log, if you want to report the issue to the developers.
Please also report this if it was a user error, so that a better error message can be provided next time.
A bug report can be filed in the tracker at <https://github.com/sphinx-doc/sphinx/issues>. Thanks!
Makefile:40: recipe for target 'html' failed
make: *** [html] Error 1
$ cat /tmp/sphinx-err-ot5tjvjw.log
# Sphinx version: 1.3.1
# Python version: 3.4.3+ (CPython)
# Docutils version: 0.12 release
# Jinja2 version: 2.7.3
# Last messages:
#   Running Sphinx v1.3.1
#   loading pickled environment...
#   not yet created
#   loading intersphinx inventory from http://docs.python.org/dev/objects.inv...
#   building [mo]: targets for 0 po files that are out of date
#   building [html]: targets for 21 source files that are out of date
#   updating environment:
#   21 added, 0 changed, 0 removed
#   reading sources... [  4%] advanced
# Loaded extensions:
#   clickdoctools (unknown version) from /tmp/click-4.0/docs/clickdoctools.py
#   alabaster (0.7.3) from /usr/lib64/python3.4/site-packages/alabaster/__init__.py
#   sphinx.ext.autodoc (1.3.1) from /usr/lib64/python3.4/site-packages/sphinx/ext/autodoc.py
#   sphinx.ext.intersphinx (1.3.1) from /usr/lib64/python3.4/site-packages/sphinx/ext/intersphinx.py
Traceback (most recent call last):
  File "/usr/lib64/python3.4/site-packages/sphinx/cmdline.py", line 245, in main
    app.build(opts.force_all, filenames)
  File "/usr/lib64/python3.4/site-packages/sphinx/application.py", line 264, in build
    self.builder.build_update()
  File "/usr/lib64/python3.4/site-packages/sphinx/builders/__init__.py", line 245, in build_update
    'out of date' % len(to_build))
  File "/usr/lib64/python3.4/site-packages/sphinx/builders/__init__.py", line 259, in build
    self.doctreedir, self.app))
  File "/usr/lib64/python3.4/site-packages/sphinx/environment.py", line 618, in update
    self._read_serial(docnames, app)
  File "/usr/lib64/python3.4/site-packages/sphinx/environment.py", line 638, in _read_serial
    self.read_doc(docname, app)
  File "/usr/lib64/python3.4/site-packages/sphinx/environment.py", line 791, in read_doc
    pub.publish()
  File "/usr/lib64/python3.4/site-packages/docutils/core.py", line 217, in publish
    self.settings)
  File "/usr/lib64/python3.4/site-packages/sphinx/environment.py", line 126, in read
    self.parse()
  File "/usr/lib64/python3.4/site-packages/docutils/readers/__init__.py", line 78, in parse
    self.parser.parse(self.input, document)
  File "/usr/lib64/python3.4/site-packages/docutils/parsers/rst/__init__.py", line 172, in parse
    self.statemachine.run(inputlines, document, inliner=self.inliner)
  File "/usr/lib64/python3.4/site-packages/docutils/parsers/rst/states.py", line 170, in run
    input_source=document['source'])
  File "/usr/lib64/python3.4/site-packages/docutils/statemachine.py", line 239, in run
    context, state, transitions)
  File "/usr/lib64/python3.4/site-packages/docutils/statemachine.py", line 460, in check_line
    return method(match, context, next_state)
  File "/usr/lib64/python3.4/site-packages/docutils/parsers/rst/states.py", line 2726, in underline
    self.section(title, source, style, lineno - 1, messages)
  File "/usr/lib64/python3.4/site-packages/docutils/parsers/rst/states.py", line 327, in section
    self.new_subsection(title, lineno, messages)
  File "/usr/lib64/python3.4/site-packages/docutils/parsers/rst/states.py", line 395, in new_subsection
    node=section_node, match_titles=True)
  File "/usr/lib64/python3.4/site-packages/docutils/parsers/rst/states.py", line 282, in nested_parse
    node=node, match_titles=match_titles)
  File "/usr/lib64/python3.4/site-packages/docutils/parsers/rst/states.py", line 195, in run
    results = StateMachineWS.run(self, input_lines, input_offset)
  File "/usr/lib64/python3.4/site-packages/docutils/statemachine.py", line 239, in run
    context, state, transitions)
  File "/usr/lib64/python3.4/site-packages/docutils/statemachine.py", line 460, in check_line
    return method(match, context, next_state)
  File "/usr/lib64/python3.4/site-packages/docutils/parsers/rst/states.py", line 2726, in underline
    self.section(title, source, style, lineno - 1, messages)
  File "/usr/lib64/python3.4/site-packages/docutils/parsers/rst/states.py", line 327, in section
    self.new_subsection(title, lineno, messages)
  File "/usr/lib64/python3.4/site-packages/docutils/parsers/rst/states.py", line 395, in new_subsection
    node=section_node, match_titles=True)
  File "/usr/lib64/python3.4/site-packages/docutils/parsers/rst/states.py", line 282, in nested_parse
    node=node, match_titles=match_titles)
  File "/usr/lib64/python3.4/site-packages/docutils/parsers/rst/states.py", line 195, in run
    results = StateMachineWS.run(self, input_lines, input_offset)
  File "/usr/lib64/python3.4/site-packages/docutils/statemachine.py", line 239, in run
    context, state, transitions)
  File "/usr/lib64/python3.4/site-packages/docutils/statemachine.py", line 460, in check_line
    return method(match, context, next_state)
  File "/usr/lib64/python3.4/site-packages/docutils/parsers/rst/states.py", line 2299, in explicit_markup
    nodelist, blank_finish = self.explicit_construct(match)
  File "/usr/lib64/python3.4/site-packages/docutils/parsers/rst/states.py", line 2311, in explicit_construct
    return method(self, expmatch)
  File "/usr/lib64/python3.4/site-packages/docutils/parsers/rst/states.py", line 2054, in directive
    directive_class, match, type_name, option_presets)
  File "/usr/lib64/python3.4/site-packages/docutils/parsers/rst/states.py", line 2103, in run_directive
    result = directive_instance.run()
  File "/usr/lib64/python3.4/site-packages/sphinx/domains/__init__.py", line 197, in run
    return BaseDirective.run(self)
  File "/tmp/click-4.0/docs/clickdoctools.py", line 245, in run
    rv = runner.run('\n'.join(self.content))
  File "/tmp/click-4.0/docs/clickdoctools.py", line 186, in run
    'isolated_filesystem': isolated_filesystem,
  File "<docs>", line 1, in <module>
  File "/tmp/click-4.0/docs/clickdoctools.py", line 172, in invoke
    with isolation(input=input, env=env) as output:
  File "/usr/lib64/python3.4/contextlib.py", line 59, in __enter__
    return next(self.gen)
  File "/tmp/click-4.0/docs/clickdoctools.py", line 73, in isolation
    if isinstance(input, unicode):
NameError: name 'unicode' is not defined

@untitaker
Copy link
Contributor

This was fixed shortly after the release of 4.0 through 046c1d7.

I was running off master, which is why I couldn't reproduce it.

@Arfrever
Copy link

Arfrever commented Apr 6, 2015

I filed bug #321 for the still reproducible problem with Python 3.

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

No branches or pull requests

3 participants