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

Exception in ServerManager.execute: 'a bytes-like object is required, not 'str'" Error #37

Open
Mayflyyh opened this issue Dec 7, 2024 · 3 comments

Comments

@Mayflyyh
Copy link

Mayflyyh commented Dec 7, 2024

Hello,

I noticed that the function execute in the Class ServerManager currently includes the line self.process.stdin.write(f"{command}\n"), which seems to trigger an exception with the following message:

[Server] Exception: a bytes-like object is required, not 'str'

Could you please confirm whether this is intentional or if it’s a bug?

Thank you for your reply, and I want to acknowledge the excellent work you’re doing!

@YXHXianYu
Copy link
Collaborator

It's a bug. This function works properly on Windows 11 and Ubuntu 22.04 LTS. Maybe it's because some character encoding issues related to the platform (such as those related to Java Minecraft Server)

Could you provide more detailed information?

Thank you for your attention! We are glad that someone is interested in our project

@Mayflyyh
Copy link
Author

Mayflyyh commented Dec 7, 2024

I am running this on Ubuntu 22.04 with WSL, and my Python version is 3.11.10.
I’ve noticed that when the code enters except Exception as e:, it seems that no message is displayed in the console. As a result, even if self.process.stdin.write(f"{command}\n") triggers an exception, the person running the program might not notice it (although I’m not entirely sure what specific impact this bug might have). Perhaps adding a warning would be helpful.

Thank you for your response! This is great work.

@YXHXianYu
Copy link
Collaborator

Oh, I see what you mean. I will add some warning later.

Thank you for pointing out this issue!

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