8000 File path error with reports.py · Issue #13 · Quantika14/osint-suite-tools · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

File path error with reports.py #13

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

Open
AiAiWilly opened this issue Aug 2, 2024 · 1 comment
Open

File path error with reports.py #13

AiAiWilly opened this issue Aug 2, 2024 · 1 comment

Comments

@AiAiWilly
Copy link
AiAiWilly commented Aug 2, 2024

In the html_ reports module the reports.py has the following code:

`

If no custom path, use one of the predefined templates

    if template_path is None:
        relative_uri = f"html_reports/templates/{template_name}.html"

        template_uri = os.sep.join(
            [easydev.get_package_location("html_reports")] + relative_uri.split("/")
        )

`
Which results in following error on execution of the script:

NotADirectoryError: [Errno 20] Not a directory: '/home/%user%/.local/lib/python3.10/site-packages/html_reports/ __init__.py /html_reports/templates/simple.html'

In my case anyway :-)

@AiAiWilly
Copy link
Author
AiAiWilly commented Aug 4, 2024

This is what solved the problem for me in the end...

Problem 1: My system: linux/ubuntu on wsl
Problem 2: Easydev get package location is used/designed for installations, going to the __init__ file, in my case anyway
Problem 3: Double "html_reports" directory, coming from easydev and repeated in the original relative_uri

`
if template_path is None:
relative_uri = f"templates/{template_name}.html"

        uribase_1 = os.sep.join([easydev.get_package_location("html_reports")])

        uribase_2 = os.path.dirname (uribase_1)

        template_uri = os.path.join(uribase_2, relative_uri)

`

uribase_1 unpack file path of desired installation package
uribase_2 strip __init__ file from path
os.path.join is a smarter way to join paths, according to documentation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant
0