-
Notifications
You must be signed in to change notification settings - Fork 81
The presence.close()
Method raises ValueError: I/O operation on closed pipe
on Windows 11
#252
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
Comments
presence.close()
Method raises ValueError: I/O operation on closed pipe
on Windowspresence.close()
Method raises ValueError: I/O operation on closed pipe
on Windows 11
Script used: from pypresence import Presence
import time
def main():
# Replace with your application's client ID (found in Discord Developer Portal)
CLIENT_ID = "your_client_id"
print("Creating the Discord Presence object...")
RPC = Presence(CLIENT_ID)
print("Connecting to Discord...")
RPC.connect()
# Simulate Work
time.sleep(1)
# Update the rich presence
RPC.update(
state="Coding in Python",
details="Using pypresence for Discord RPC"
)
print("Rich Presence updated.")
print("Waiting 3 seconds...")
# Simulate Work
time.sleep(3)
print("Closing connection.")
RPC.clear() # Clear the presence
RPC.close() # Properly close the connection
print("Disconnected from Discord.")
if __name__ == "__main__":
main() |
running on: |
I found the issue, it puts this error when wrapping the code inside |
Another interesting note, when wrapping the RPC code in a class, if the |
Error:
Am I the only one, am I doing something wrong ??
The text was updated successfully, but these errors were encountered: