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

[Bug] PATH setting discrepancy between the main exectable and Python API for scripts on Windows #3695

Open
wenzeslaus opened this issue May 8, 2024 · 0 comments
Labels
bug Something isn't working Windows Microsoft Windows specific

Comments

@wenzeslaus
Copy link
Member

While the grass init script (the main executable) sets this:

    if not WINDOWS:
        path_prepend(gpath("scripts"), "PATH")
    path_prepend(gpath("bin"), "PATH")

the Python API in grass.script sets the following:

    path_addition = os.pathsep + os.path.join(gisbase, "bin")
    path_addition += os.pathsep + os.path.join(gisbase, "scripts")
    if WINDOWS:
        path_addition += os.pathsep + os.path.join(gisbase, "extrabin")

The difference in adding extrabin in grass.script is given by the fact that the init script on Windows is wrapped with a .bat script which sets extrabin, so the init script does not need to add that.

However, I'm not clear about scripts. On everything else except Windows, things are in scripts, but not on Windows. Is that correct? Should the new code be:

    path_addition = os.pathsep + os.path.join(gisbase, "bin")
    if WINDOWS:
        path_addition += os.pathsep + os.path.join(gisbase, "extrabin")
    else:
        path_addition += os.pathsep + os.path.join(gisbase, "scripts")

?

@wenzeslaus wenzeslaus added bug Something isn't working Windows Microsoft Windows specific labels May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Windows Microsoft Windows specific
Projects
None yet
Development

No branches or pull requests

1 participant