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

Unhelpful error message when java is not installed on macos #30

Open
sammko opened this issue Dec 10, 2022 · 0 comments
Open

Unhelpful error message when java is not installed on macos #30

sammko opened this issue Dec 10, 2022 · 0 comments
Labels
enhancement New feature or request macos

Comments

@sammko
Copy link
Owner

sammko commented Dec 10, 2022

macOS has a default java even when java is not installed. The javainfo process tries to get information out of it and naturally fails parsing the expected XML output.

INFO Using version: latest -> 1.19.3
INFO Using account: sammko
Traceback (most recent call last):
  File "/Users/sammko/.local/bin/picomc", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/Users/sammko/.local/pipx/venvs/picomc/lib/python3.11/site-packages/picomc/__init__.py", line 18, in main
    picomc_cli()
  File "/Users/sammko/.local/pipx/venvs/picomc/lib/python3.11/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/sammko/.local/pipx/venvs/picomc/lib/python3.11/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/Users/sammko/.local/pipx/venvs/picomc/lib/python3.11/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/sammko/.local/pipx/venvs/picomc/lib/python3.11/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/sammko/.local/pipx/venvs/picomc/lib/python3.11/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/sammko/.local/pipx/venvs/picomc/lib/python3.11/site-packages/click/decorators.py", line 84, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/sammko/.local/pipx/venvs/picomc/lib/python3.11/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/sammko/.local/pipx/venvs/picomc/lib/python3.11/site-packages/picomc/cli/utils.py", line 16, in wrapper
    fn(x, *a, **kwa)
  File "/Users/sammko/.local/pipx/venvs/picomc/lib/python3.11/site-packages/click/decorators.py", line 84, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/sammko/.local/pipx/venvs/picomc/lib/python3.11/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/sammko/.local/pipx/venvs/picomc/lib/python3.11/site-packages/picomc/cli/utils.py", line 16, in wrapper
    fn(x, *a, **kwa)
  File "/Users/sammko/.local/pipx/venvs/picomc/lib/python3.11/site-packages/click/decorators.py", line 84, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/sammko/.local/pipx/venvs/picomc/lib/python3.11/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/sammko/.local/pipx/venvs/picomc/lib/python3.11/site-packages/picomc/cli/play.py", line 40, in play
    inst.launch(account, version, verify_hashes=verify)
  File "/Users/sammko/.local/pipx/venvs/picomc/lib/python3.11/site-packages/picomc/instance.py", line 127, in launch
    java_info = assert_java(java, vobj.java_version)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/sammko/.local/pipx/venvs/picomc/lib/python3.11/site-packages/picomc/java/javainfo.py", line 84, in assert_java
    jinfo = get_java_info(java)
            ^^^^^^^^^^^^^^^^^^^
  File "/Users/sammko/.local/pipx/venvs/picomc/lib/python3.11/site-packages/picomc/java/javainfo.py", line 40, in get_java_info
    props = ElementTree.fromstring(xmlstr)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/python@3.11/3.11.0/Frameworks/Python.framework/Versions/3.11/lib/python3.11/xml/etree/ElementTree.py", line 1339, in XML
    return parser.close()
           ^^^^^^^^^^^^^^
xml.etree.ElementTree.ParseError: no element found: line 1, column 0
@sammko sammko added enhancement New feature or request macos labels Dec 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request macos
Projects
None yet
Development

No branches or pull requests

1 participant