Bug 392428 - kapidox_generate fails in 'create_dirs' (no such file or directory)
Summary: kapidox_generate fails in 'create_dirs' (no such file or directory)
Status: RESOLVED FIXED
Alias: None
Product: frameworks-kapidox
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 5.52.0
Platform: Neon Linux
: NOR normal
Target Milestone: ---
Assignee: kdelibs bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-03-27 20:25 UTC by Scott Harvey
Modified: 2018-11-11 11:58 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Scott Harvey 2018-03-27 20:25:04 UTC
I'm trying to run kapidox_generate against a local copy of KWindowSystem, as I've got some minor changes to submit. I've got all the dependencies installed (except Graphviz; I know that's missing), but the generator fails with a Python 'mkdir' error.

I'm running from an empty directory. Output as follows...

----

$ kapidox_generate /home/bundito/kwindowsystem/ 
15:20:38 WARNING Missing Graphviz dependency: diagrams will not be generated.
15:20:38 DEBUG Found cached identities file at /home/bundito/.cache/kapidox/kde-accounts
15:20:38 WARNING Group of KWindowSystem not found: dropped.
15:20:38 INFO # Generating doc for KWindowSystem
Traceback (most recent call last):
  File "/usr/local/bin/kapidox_generate", line 110, in <module>
    main()
  File "/usr/local/bin/kapidox_generate", line 106, in main
    copyright=kde_copyright)
  File "/usr/local/lib/python2.7/dist-packages/kapidox/hlfunctions.py", line 119, in do_it
    generator.gen_fw_apidocs(ctx, tmp_dir)
  File "/usr/local/lib/python2.7/dist-packages/kapidox/generator.py", line 700, in gen_fw_apidocs
    create_dirs(ctx)
  File "/usr/local/lib/python2.7/dist-packages/kapidox/generator.py", line 205, in create_dirs
    os.makedirs(ctx.outputdir)
  File "/usr/lib/python2.7/os.py", line 157, in makedirs
    mkdir(name, mode)
OSError: [Errno 2] No such file or directory: ''

----

Is this a bug? Am I still missing a dependency? Am I invoking this incorrectly?
Comment 1 argonel 2018-11-11 05:00:29 UTC
(In reply to Scott Harvey from comment #0)

<snip>

> $ kapidox_generate /home/bundito/kwindowsystem/ 

<snip>

> OSError: [Errno 2] No such file or directory: ''

> Is this a bug? Am I still missing a dependency? Am I invoking this incorrectly?

I would say yes, it is a bug - and technically you are invoking it incorrectly.

If you look very closely at the docs, the example is:

> ~/src/frameworks/kapidox/src/kapidox_generate ~/src/frameworks/kcoreaddons

... note the lack of trailing slash.

You have a trailing / in your invocation, which causes the script to fail.

The script should either handle this gracefully or output a reasonable error message.
Comment 2 Olivier Churlaud 2018-11-11 11:58:57 UTC
Git commit 34b86963bebd8ba8b9ec96e4235728f4623476e9 by Olivier CHURLAUD.
Committed on 11/11/2018 at 11:57.
Pushed by ochurlaud into branch 'master'.

Normalize all input paths with the os.path.normpath function.
This prevents possible crashes on bad shaped paths.

M  +9    -6    src/kapidox/argparserutils.py

https://commits.kde.org/kapidox/34b86963bebd8ba8b9ec96e4235728f4623476e9