Discord Thread Issue #9

Closed
opened 2020-10-21 07:34:48 +00:00 by alex_orid · 2 comments
Owner

Currently it works on Windows 3.7.7 on my desktop,
but it fails on linux 3.7.9 and 3.8.5

The Discord script and the Twitch Script run fine on their own, but the Discord script does not while using threads.

(praxisvenv) [alex@praxis Praxis_Bot]$ python --version
Python 3.7.9
(praxisvenv) [alex@praxis Praxis_Bot]$ python main.py
compiling /home/alex/Praxis_Bot/commands/implemented/command_roll.py
Successfully loaded CommandRoll: !roll
compiling /home/alex/Praxis_Bot/commands/implemented/command_tts.py
Successfully loaded CommandTTS: !tts
compiling /home/alex/Praxis_Bot/commands/implemented/command_roll_discord.py
Successfully loaded CommandRoll: !roll
compiling /home/alex/Praxis_Bot/commands/implemented/command_test.py
Successfully loaded CommandTest: !test
compiling /home/alex/Praxis_Bot/commands/implemented/command_tts_discord.py
Successfully loaded CommandTTS: !tts
compiling /home/alex/Praxis_Bot/commands/implemented/command_roll.py
Successfully loaded CommandRoll: !roll
compiling /home/alex/Praxis_Bot/commands/implemented/command_tts.py
Successfully loaded CommandTTS: !tts
compiling /home/alex/Praxis_Bot/commands/implemented/command_roll_discord.py
Successfully loaded CommandRoll: !roll
compiling /home/alex/Praxis_Bot/commands/implemented/command_test.py
Successfully loaded CommandTest: !test
compiling /home/alex/Praxis_Bot/commands/implemented/command_tts_discord.py
Successfully loaded CommandTTS: !tts
Loading credentials...
Searching for credential named: praxis_bot
.\{DB Credential Detected}
Searching for DB Credential named: praxis_bot
DB Credential Found: {praxis_bot}
Searching for Twitch Credential named: praxis_bot
Twitch Credential Found: {praxis_bot}
Searching for Discord Credential named: praxis_bot
Discord Credential Found: {praxis_bot}
---Post Thread Creation Test---
Exception in thread Thread-2:
Traceback (most recent call last):
  File "/usr/lib/python3.7/asyncio/unix_events.py", line 92, in add_signal_handler
    signal.set_wakeup_fd(self._csock.fileno())
ValueError: set_wakeup_fd only works in main thread

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.7/threading.py", line 926, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.7/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "main.py", line 38, in discord_module_init
    discord_connection.main()
  File "/home/alex/Praxis_Bot/discord_script.py", line 36, in main
    self.run(self.discordCredential.token)
  File "/home/alex/Praxis_Bot/praxisvenv/lib/python3.7/site-packages/discord/client.py", line 680, in run
    loop.add_signal_handler(signal.SIGINT, lambda: loop.stop())
  File "/usr/lib/python3.7/asyncio/unix_events.py", line 94, in add_signal_handler
    raise RuntimeError(str(exc))
RuntimeError: set_wakeup_fd only works in main thread

SQL Engine Created
Connecting to Channel: #thecuriousnerd
Connected to Channel:  #thecuriousnerd
---Point of no return---
Currently it works on Windows 3.7.7 on my desktop, but it fails on linux 3.7.9 and 3.8.5 The Discord script and the Twitch Script run fine on their own, but the Discord script does not while using threads. ``` (praxisvenv) [alex@praxis Praxis_Bot]$ python --version Python 3.7.9 (praxisvenv) [alex@praxis Praxis_Bot]$ python main.py compiling /home/alex/Praxis_Bot/commands/implemented/command_roll.py Successfully loaded CommandRoll: !roll compiling /home/alex/Praxis_Bot/commands/implemented/command_tts.py Successfully loaded CommandTTS: !tts compiling /home/alex/Praxis_Bot/commands/implemented/command_roll_discord.py Successfully loaded CommandRoll: !roll compiling /home/alex/Praxis_Bot/commands/implemented/command_test.py Successfully loaded CommandTest: !test compiling /home/alex/Praxis_Bot/commands/implemented/command_tts_discord.py Successfully loaded CommandTTS: !tts compiling /home/alex/Praxis_Bot/commands/implemented/command_roll.py Successfully loaded CommandRoll: !roll compiling /home/alex/Praxis_Bot/commands/implemented/command_tts.py Successfully loaded CommandTTS: !tts compiling /home/alex/Praxis_Bot/commands/implemented/command_roll_discord.py Successfully loaded CommandRoll: !roll compiling /home/alex/Praxis_Bot/commands/implemented/command_test.py Successfully loaded CommandTest: !test compiling /home/alex/Praxis_Bot/commands/implemented/command_tts_discord.py Successfully loaded CommandTTS: !tts Loading credentials... Searching for credential named: praxis_bot .\{DB Credential Detected} Searching for DB Credential named: praxis_bot DB Credential Found: {praxis_bot} Searching for Twitch Credential named: praxis_bot Twitch Credential Found: {praxis_bot} Searching for Discord Credential named: praxis_bot Discord Credential Found: {praxis_bot} ---Post Thread Creation Test--- Exception in thread Thread-2: Traceback (most recent call last): File "/usr/lib/python3.7/asyncio/unix_events.py", line 92, in add_signal_handler signal.set_wakeup_fd(self._csock.fileno()) ValueError: set_wakeup_fd only works in main thread During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/lib/python3.7/threading.py", line 926, in _bootstrap_inner self.run() File "/usr/lib/python3.7/threading.py", line 870, in run self._target(*self._args, **self._kwargs) File "main.py", line 38, in discord_module_init discord_connection.main() File "/home/alex/Praxis_Bot/discord_script.py", line 36, in main self.run(self.discordCredential.token) File "/home/alex/Praxis_Bot/praxisvenv/lib/python3.7/site-packages/discord/client.py", line 680, in run loop.add_signal_handler(signal.SIGINT, lambda: loop.stop()) File "/usr/lib/python3.7/asyncio/unix_events.py", line 94, in add_signal_handler raise RuntimeError(str(exc)) RuntimeError: set_wakeup_fd only works in main thread SQL Engine Created Connecting to Channel: #thecuriousnerd Connected to Channel: #thecuriousnerd ---Point of no return--- ```
Author
Owner

Is this a possible solution?

https://stackoverflow.com/a/55054500

Is this a possible solution? https://stackoverflow.com/a/55054500
alex_orid changed title from Current Issue to Discord Thread Issue 2020-11-17 01:40:09 +00:00
Author
Owner

Solved

Solved
Sign in to join this conversation.
No Label
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: alex_orid/Praxis_Bot#9
No description provided.