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

SedRegex doesn't work anymore for me in Windows 11 because of error spawning processes #1567

Open
inhahe opened this issue Dec 14, 2023 · 2 comments

Comments

@inhahe
Copy link

inhahe commented Dec 14, 2023

SedRegex randomly stopped working for me on Windows 11. I had to switch the bot to running on WSL, now it works. I tried rebooting, I tried installing the latest Python and installing the latest Limnoria on it, didn't help. Here's the traceback:

Traceback (most recent call last):
  File "C:\venv\dumb_bot\Lib\site-packages\supybot\plugins\SedRegex\plugin.py", line 180, in replacer
    message = process(self._replacer_process, irc, msg,
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\venv\dumb_bot\Lib\site-packages\supybot\commands.py", line 141, in process
    p.start()
  File "C:\Python3.11.2\Lib\multiprocessing\process.py", line 121, in start
    self._popen = self._Popen(self)
                  ^^^^^^^^^^^^^^^^^
  File "C:\Python3.11.2\Lib\multiprocessing\context.py", line 224, in _Popen
    return _default_context.get_context().Process._Popen(process_obj)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python3.11.2\Lib\multiprocessing\context.py", line 336, in _Popen
    return Popen(process_obj)
           ^^^^^^^^^^^^^^^^^^
  File "C:\Python3.11.2\Lib\multiprocessing\popen_spawn_win32.py", line 94, in __init__
    reduction.dump(process_obj, to_child)
  File "C:\Python3.11.2\Lib\multiprocessing\reduction.py", line 60, in dump
    ForkingPickler(file, protocol).dump(obj)
_pickle.PicklingError: args[0] from __newobj__ args has the wrong class
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Python3.11.2\Lib\multiprocessing\spawn.py", line 111, in spawn_main
    new_handle = reduction.duplicate(pipe_handle,
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python3.11.2\Lib\multiprocessing\reduction.py", line 79, in duplicate
    return _winapi.DuplicateHandle(
           ^^^^^^^^^^^^^^^^^^^^^^^^
OSError: [WinError 6] The handle is invalid
Advertisement
@progval
Copy link
Owner

progval commented Dec 15, 2023

Could you add debug logs? (To get them, set supybot.log.level or supybot.log.stdout.level to DEBUG, trigger the crash, then set it back to INFO)

@inhahe
Copy link
Author

inhahe commented Dec 15, 2023

DEBUG 2023-12-15T02:42:22 Incoming message (Undernet): :inhahe`!~inhahe@inhahe.users.undernet.org PRIVMSG #music&love :45this is a test
DEBUG 2023-12-15T02:42:29 Incoming message (Undernet): :inhahe`!~inhahe@inhahe.users.undernet.org PRIVMSG #music&love :s/test/testing/
DEBUG 2023-12-15T02:42:29 SedRegex: running on Undernet/#music&love for <re.Match object; span=(0, 15), match='s/test/testing/'>
DEBUG 2023-12-15T02:42:29 Spawning process Process #1 (for SedRegex.replacer) (args: (<bound method SedRegex._replacer_process of <SedRegex SedRegex <SedRegex.plugin.SedRegex object at 0x000002866EB53C90>>>, <multiprocessing.queues.Queue object at 0x000002866ED373D0>, <supybot.callbacks.ReplyIrcProxy object at 0x000002866ED6FF90>, IrcMsg(server_tags={}, prefix="inhahe`!~inhahe@inhahe.users.undernet.org", command="PRIVMSG", args=('#music&love', 's/test/testing/')), None, re.compile('test'), 'testing', 1, <reversed object at 0x000002866EB44460>))
DEBUG 2023-12-15T02:42:29 Spawning process "Process #1 (for SedRegex.replacer)".
WARNING 2023-12-15T02:42:29 SedRegex replacer error: args[0] from __newobj__ args has the wrong class
Traceback (most recent call last):
  File "C:\venv\dumb_bot\Lib\site-packages\supybot\plugins\SedRegex\plugin.py", line 180, in replacer
    message = process(self._replacer_process, irc, msg,
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\venv\dumb_bot\Lib\site-packages\supybot\commands.py", line 141, in process
    p.start()
  File "C:\Python3.11.2\Lib\multiprocessing\process.py", line 121, in start
    self._popen = self._Popen(self)
                  ^^^^^^^^^^^^^^^^^
  File "C:\Python3.11.2\Lib\multiprocessing\context.py", line 224, in _Popen
    return _default_context.get_context().Process._Popen(process_obj)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python3.11.2\Lib\multiprocessing\context.py", line 336, in _Popen
    return Popen(process_obj)
           ^^^^^^^^^^^^^^^^^^
  File "C:\Python3.11.2\Lib\multiprocessing\popen_spawn_win32.py", line 94, in __init__
    reduction.dump(process_obj, to_child)
  File "C:\Python3.11.2\Lib\multiprocessing\reduction.py", line 60, in dump
    ForkingPickler(file, protocol).dump(obj)
_pickle.PicklingError: args[0] from __newobj__ args has the wrong class
DEBUG 2023-12-15T02:42:29 Incoming message (Undernet): PRIVMSG #music&love :inhahe`: Error: _pickle.PicklingError: args[0] from __newobj__ args has the wrong class
DEBUG 2023-12-15T02:42:29 Outgoing message (Undernet): PRIVMSG #music&love :inhahe`: Error: _pickle.PicklingError: args[0] from __newobj__ args has the wrong class
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Python3.11.2\Lib\multiprocessing\spawn.py", line 111, in spawn_main
    new_handle = reduction.duplicate(pipe_handle,
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python3.11.2\Lib\multiprocessing\reduction.py", line 79, in duplicate
    return _winapi.DuplicateHandle(
           ^^^^^^^^^^^^^^^^^^^^^^^^
OSError: [WinError 6] The handle is invalid

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants