Issues

Issue #1226 closed

Sphinx runs my code, then crashes

Anonymous created an issue

When running make html after setting up with sphinx-apidoc in autodoc mode, it seems that sphinx is running my code, when it opens up my GUI (from within the package). If I then close the GUI window, sphinx crashes like so:

usage: sphinx-build [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]       
   or: sphinx-build --help [cmd1 cmd2 ...]
   or: sphinx-build --help-commands
   or: sphinx-build cmd --help

error: option -b not recognized
make: *** [html] Error 1

Comments (10)

  1. Takayuki Shimizukawa

    From #sphinx-doc IRC channel

    Friday, July 4th, 2014
    16:45 <_lex> hi guys. i'm trying to build sphinx documentation for a project, i am using autodoc because we maintain the documentation automatically via Jenkins and GIT so every change we do is automatically seen by Jenkins via SCM change in GIT and triggers the documentation to be built which is great
    16:46 <_lex> i am recently encountering one issue though, before it worked fine but i cannot seem to grasp why it fails now. i do append the pth correctly: sys.path.append('../')
    16:46 <_lex> and i get: make clean; make html  --->     error: option -b not recognized
    16:47 <_lex> if i try to use the module itself in the src, it'll give import error and i guess is correct because the 'src' is considered as module (it is actually the folder where i just copy the whole library of *.py files)
    16:48 <_lex> Sphinx v1.1.3 -- on debian and ubuntu systems
    16:51 <_lex> http://codepad.org/rGfpqvD5 ;  and trying with the module itself in the path (import error case): http://codepad.org/zuXGNTgP  (the html is generated but of course, the modules pages are empty)
    16:56 <_lex> any thoughts on this please? it indeed fails after a recent commit i did on changing the docstrings to include :doc:`<name of module>` but I reverted manually and retried and still fails, so its not this apparently
    17:15 <_lex> trying with changed directory from 'src' to 'sources' (name): docs$ sphinx-build . _build/html/    prompts: invalid command name '.'] sources  no idea honestly what is going on here
    18:19 <_lex> really, nobody?
    18:22 <shimizukawa> here, but I'm working now
    18:23 <_lex> me too :D
    18:23 <shimizukawa> I'll take a look later
    18:23 <_lex> thanks a lot shimizukawa
    18:40 <shimizukawa> please remove src.setup from  src.rst
    18:41 <shimizukawa> it'll invoke setup process
    18:46 <_lex> you are the best shimizukawa
    18:46 <_lex> that was indeed the issue, but the output is very counterintuitive
    18:46 <_lex> how can we improve this?
    18:47 <_lex> can we make sphinx report an execution of a script that failed so that you get accurate results instead of counterintuitive output?
    

    I found same reports at ML:

    I think I can prevent the behavior by using except SystemExit: clause.

  2. arek m

    I'm still seeing this with 1.2.3

    $ make html
    mkdir -p build/html build/doctrees
    sphinx-build -b html -d build/doctrees   . build/html
    Running Sphinx v1.2.3
    usage: sphinx-build [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
       or: sphinx-build --help [cmd1 cmd2 ...]
       or: sphinx-build --help-commands
       or: sphinx-build cmd --help
    
    error: option -b not recognized
    Makefile:30: recipe for target 'html' failed
    make: *** [html] Error 1
    

    BUT I have also a host where this works fine

    $ make html
    mkdir -p build/html build/doctrees
    sphinx-build -b html -d build/doctrees   . build/html
    Running Sphinx v1.2.3
    loading pickled environment... not yet created
    building [html]: targets for 13 source files that are out of date
    updating environment: 13 added, 0 changed, 0 removed
    

    So looks like not fully fixed. On both systems I'm building setuptools 6.0.1.

    What else cold be important here aka why on one system works and fails on the other?

  3. Georg Brandl repo owner

    OK, we debugged arek's case and the problem was a stray third-party "setup.py" on PYTHONPATH when setuptools' conf.py did "import setup" to get their own setup.py script.

  4. Log in to comment