Skip to content

Path issue when src_root and source is in same folder #133

@pronuba66

Description

@pronuba66

When i'm running with --src_root .
i can only see subfolders and main.c is missing. symbols from main is available in "Show all symbols"
but when i try to access it through http://127.0.0.1:8123/path/main.c/main/ i'm getting "Internal Server Error"

Im able to overcome this by making --src_root ../stack.
Here ../stack/ is the CWD and im able to view main.c but all folders/sources are now absolute paths.

Adding the python logs below

Traceback (most recent call last):
  File "/Users/joe/workspace/stack/.venv/lib/python3.13/site-packages/flask/app.py", line 2529, in wsgi_app
    response = self.full_dispatch_request()
  File "/Users/joe/workspace/stack/.venv/lib/python3.13/site-packages/flask/app.py", line 1825, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/Users/joe/workspace/stack/.venv/lib/python3.13/site-packages/flask/app.py", line 1823, in full_dispatch_request
    rv = self.dispatch_request()
  File "/Users/joe/workspace/stack/.venv/lib/python3.13/site-packages/flask/app.py", line 1799, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
  File "/Users/joe/workspace/stack/.venv/lib/python3.13/site-packages/flask/views.py", line 107, in view
    return current_app.ensure_sync(self.dispatch_request)(**kwargs)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^
  File "/Users/joe/workspace/stack/.venv/lib/python3.13/site-packages/puncover/renderers.py", line 341, in dispatch_request
    return self.render_template("symbol.html.jinja", "symbol")
           ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/joe/workspace/stack/.venv/lib/python3.13/site-packages/puncover/renderers.py", line 294, in render_template
    return render_template(template_name, **self.template_vars)
  File "/Users/joe/workspace/stack/.venv/lib/python3.13/site-packages/flask/templating.py", line 147, in render_template
    return _render(app, template, context)
  File "/Users/joe/workspace/stack/.venv/lib/python3.13/site-packages/flask/templating.py", line 130, in _render
    rv = template.render(context)
  File "/Users/joe/workspace/stack/.venv/lib/python3.13/site-packages/jinja2/environment.py", line 1295, in render
    self.environment.handle_exception()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/Users/joe/workspace/stack/.venv/lib/python3.13/site-packages/jinja2/environment.py", line 942, in handle_exception
    raise rewrite_traceback_stack(source=source)
  File "/Users/joe/workspace/stack/.venv/lib/python3.13/site-packages/puncover/templates/symbol.html.jinja", line 2, in top-level template code
    {% import 'lists.html.jinja' as lists with context %}
    ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/joe/workspace/stack/.venv/lib/python3.13/site-packages/puncover/templates/base.html.jinja", line 32, in top-level template code
    {% block content %}{% endblock %}
    ^^^^^^^^^^^^^^^^^
  File "/Users/joe/workspace/stack/.venv/lib/python3.13/site-packages/puncover/templates/symbol.html.jinja", line 6, in block 'content'
    {{ lists.breadcrumbs(symbol.file.folder, symbol.file, symbol.line) }}
    ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/joe/workspace/stack/.venv/lib/python3.13/site-packages/jinja2/runtime.py", line 784, in _invoke
    rv = self._func(*arguments)
  File "/Users/joe/workspace/stack/.venv/lib/python3.13/site-packages/puncover/templates/lists.html.jinja", line 10, in template
    <a href="{{ folder | symbol_url }}">{{ folder.name | e}}</a>
    ^^^^^^^^^^^^^
  File "/Users/joe/workspace/stack/.venv/lib/python3.13/site-packages/puncover/renderers.py", line 42, in symbol_url_filter
    return renderer.url_for_symbol(value)
           ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^
  File "/Users/joe/workspace/stack/.venv/lib/python3.13/site-packages/puncover/renderers.py", line 315, in url_for_symbol
    if value[collector.TYPE] in [collector.TYPE_FUNCTION]:
       ~~~~~^^^^^^^^^^^^^^^^
TypeError: 'NoneType' object is not subscriptable
127.0.0.1 - - [02/Dec/2025 11:03:59] "GET /path/main.c/main/ HTTP/1.1" 500 -

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions