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

execution of a pyoxidizer binary fails if importing a file with spaces #720

Open
mark-thm opened this issue Oct 20, 2023 · 1 comment
Open

Comments

@mark-thm
Copy link

Running the following configuration to build and run scoutsuite==5.13.0 results in a successful build but an un-runnable package:

def make_exe():
    dist = default_python_distribution()
    policy = dist.make_python_packaging_policy()
    policy.resources_location = "filesystem-relative:lib"
    policy.resources_location_fallback = "filesystem-relative:lib"
    python_config = dist.make_python_interpreter_config()
    python_config.run_module = "ScoutSuite"
    exe = dist.to_python_executable(
        name = "scout-oxide",
        packaging_policy = policy,
        config = python_config,
    )
    exe.add_python_resources(exe.pip_install(["scoutsuite==5.13.0"]))
    return exe

At runtime it fails with this error:

Traceback (most recent call last):
  File "runpy", line 196, in _run_module_as_main
  File "runpy", line 86, in _run_code
  File "ScoutSuite.__main__", line 15, in <module>
  File "ScoutSuite.core.server", line 2, in <module>
  File "cherrypy", line 66, in <module>
  File "cherrypy._cperror", line 135, in <module>
  File "cherrypy.lib.httputil", line 20, in <module>
  File "jaraco.collections", line 12, in <module>
  File "jaraco.text", line 231, in <module>
  File "importlib.abc", line 378, in read_text
  File "importlib._adapters", line 54, in open
ValueError

jaroco.text is trying to load a file from the python path with a space in it.

The maintainer of jaroco.text has made clear that files with spaces in them should be valid and is not willing to remove the space or modify the code that loads the file, and has requested that when encountering tools that don't support files with spaces to file upstream issues. (See 1, 2)

While not a minimal repro, I'm pretty sure this is pyoxidizer running into an issue with files with spaces on the python path.

@jaraco
Copy link

jaraco commented Jun 1, 2024

If someone could point to the code where PyOxidizer is relying on filenames not to have spaces, I'd be willing to help devise a solution. For example, where is the resource loader implemented and where does it process paths?

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

2 participants