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

Logging twice when importing winerp with discord.py #17

Closed
ljouhault opened this issue Apr 14, 2023 · 3 comments · Fixed by #18
Closed

Logging twice when importing winerp with discord.py #17

ljouhault opened this issue Apr 14, 2023 · 3 comments · Fixed by #18

Comments

@ljouhault
Copy link

import discord
import winerp


class MyClient(discord.Client):
    async def on_message(self, message):
        if message.content == 'raise error':
            raise Exception('test2')


intents = discord.Intents.all()
intents.typing = False
client = MyClient(intents = intents)


client.run(TOKEN)

This simple code, when using the raise error command, logs the exception twice, but the exact same code, without the second line import winerp logs only once. (note that winerp is not used at all here, only imported).

Tried and reproduced on windows and debian, with python 3.9 to 3.11

@nouman0103
Copy link
Owner

did you install winerp using pypi or git?

@ljouhault
Copy link
Author

Pypi, and I'm up to date

@nouman0103
Copy link
Owner

nouman0103 commented Apr 14, 2023

I have identified the issue. Seems like the dependent module websockets_server uses basicConfig which also enables the logging for discord.py
Pithikos/python-websocket-server#85

Until the new version is published to pypi, you can use the beta version on github:
pip install git+https://www.github.com/BlackThunder01001/winerp

@nouman0103 nouman0103 linked a pull request Apr 14, 2023 that will close 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

Successfully merging a pull request may close this issue.

2 participants