-
Notifications
You must be signed in to change notification settings - Fork 11
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
SessionClient has no attribute _terminate_on_server #100
Comments
Happens when I call |
For some reason wine is not in my PATH anymore which surely didn't help: EDIT: having it in my path again makes the code not go to the same path again |
Hi @astrale-sharp can this be marked as resolved them? |
I mean, I don't have an issue anymore but isn't it a bit akward to have a undefined function there? 😇 |
You are right - this function is created if Wine is up and running. If not, it does not exist. This needs better error handling. |
We could check for the presence of the function and Raise an error hinting at wine being not present? I don't mind doing a quick PR either ;) |
I'd happily accept a PR. Though, if Wine is not present, a session should fail to start much earlier, not in this code path - this kind of failure mode is unusual. Can you reproduce this issue? |
quick hack : Then ❯ python3
Python 3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from zugbruecke.ctypes import windll
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/astrale/.local/lib/python3.10/site-packages/zugbruecke/ctypes/__init__.py", line 44, in <module>
_session = _CtypesSession()
File "/home/astrale/.local/lib/python3.10/site-packages/zugbruecke/core/session.py", line 129, in __init__
self._current_session = SessionClient(config=Config(**kwargs))
File "/home/astrale/.local/lib/python3.10/site-packages/zugbruecke/core/session_client.py", line 116, in __init__
self._wait_for_server_status_change(target_status=True)
File "/home/astrale/.local/lib/python3.10/site-packages/zugbruecke/core/session_client.py", line 328, in _wait_for_server_status_change
raise TimeoutError("session server did not appear")
TimeoutError: session server did not appear
>>>
If I understand correctly, this call to PythonVersion will verify that the arch is known and the version is valid but not that wine is accessible which the Config should maybe do at this point? |
On second thought Then we stumble upon this # wenv/_core/env.py:394
proc = subprocess.Popen(["wine", "wineboot", "-i"], env=envvar_dict)
proc.wait()
if proc.returncode != 0:
sys.exit(1) Instead of just exiting with an error code here we could also print a warning hinting at the absence of wine |
in and the process initialize wine if in overwrite mode.. maybe this would be a good place to check if wine is in the path anyway? either in |
I think I'd try to last message from this intense spamming I swear 😅 |
That's actually the intended behavior, a Your initial bug report suggested that you got an attribute error in the shutdown sequence instead, caused by a missing
Yep, correct. This mechanism is the foundation for fetching CPython for Windows (based on the specified version) if the version & arch is valid (i.e. there is a build that can be pulled).
Agreed.
I'd be careful with that. I'd rather check if |
Hello there, not sure exactly why I run into this code in the first place but
grepping shows that
_terminate_on_server
doesn't exist in the code base!The text was updated successfully, but these errors were encountered: