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

NotImplementedError on win32 #46

Closed
Cirn09 opened this issue Oct 18, 2021 · 4 comments
Closed

NotImplementedError on win32 #46

Cirn09 opened this issue Oct 18, 2021 · 4 comments

Comments

@Cirn09
Copy link

Cirn09 commented Oct 18, 2021

C:\Portable Program\IDA Pro 7.5\plugins\ipyida_plugin_stub.py: 
Traceback (most recent call last):
  File "C:\Portable Program\IDA Pro 7.5\python\3\ida_idaapi.py", line 616, in IDAPython_ExecScript
    exec(code, g)
  File "C:/Portable Program/IDA Pro 7.5/plugins/ipyida_plugin_stub.py", line 11, in <module>
    from ipyida.ida_plugin import PLUGIN_ENTRY, IPyIDAPlugIn
  File "C:\Portable Program\Python38\lib\site-packages\ipyida\ida_plugin.py", line 62, in <module>
    _kernel.start()
  File "C:\Portable Program\Python38\lib\site-packages\ipyida\kernel.py", line 113, in start
    app.initialize()
  File "C:\Portable Program\Python38\lib\site-packages\traitlets\config\application.py", line 86, in inner
    return method(app, *args, **kwargs)
  File "C:\Portable Program\Python38\lib\site-packages\ipykernel\kernelapp.py", line 469, in initialize
    self.init_sockets()
  File "C:\Portable Program\Python38\lib\site-packages\ipykernel\kernelapp.py", line 260, in init_sockets
    self.init_iopub(context)
  File "C:\Portable Program\Python38\lib\site-packages\ipykernel\kernelapp.py", line 268, in init_iopub
    self.iopub_thread = IOPubThread(self.iopub_socket, pipe=True)
  File "C:\Portable Program\Python38\lib\site-packages\ipykernel\iostream.py", line 68, in __init__
    self._setup_pipe_in()
  File "C:\Portable Program\Python38\lib\site-packages\ipykernel\iostream.py", line 141, in _setup_pipe_in
    self._pipe_in = ZMQStream(pipe_in, self.io_loop)
  File "C:\Portable Program\Python38\lib\site-packages\zmq\eventloop\zmqstream.py", line 127, in __init__
    self._init_io_state()
  File "C:\Portable Program\Python38\lib\site-packages\zmq\eventloop\zmqstream.py", line 552, in _init_io_state
    self.io_loop.add_handler(self.socket, self._handle_events, self.io_loop.READ)
  File "C:\Portable Program\Python38\lib\site-packages\tornado\platform\asyncio.py", line 100, in add_handler
    self.asyncio_loop.add_reader(fd, self._handle_events, fd, IOLoop.READ)
  File "C:\Portable Program\Python38\Lib\asyncio\events.py", line 501, in add_reader
    raise NotImplementedError
NotImplementedError

easy to fix, just add little code to ipyida_plugin_stub.py:

import sys
import asyncio
if sys.platform == 'win32':
    asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
@Cirn09
Copy link
Author

Cirn09 commented Oct 18, 2021

I just found out that @cxm95 has submitted a pr #34 to fix this problem
It's helpful, please merge it.

@marc-etienne
Copy link
Contributor

Thanks for bringing this problem back to my attention.

I checked IPyKernel code and it seems this change was already introduced in v5.1.4: see ipython/ipykernel@f40d74a

Can you check what version of IPyKernel version you have installed? Based on the line number of self.init_sockets() in you stack trace, I think you have <= 5.1.1.

Can you try updating the ipykernel package and try IPyIDA without the patch?

Cheers!

@Cirn09
Copy link
Author

Cirn09 commented Oct 19, 2021

Thanks for bringing this problem back to my attention.

I checked IPyKernel code and it seems this change was already introduced in v5.1.4: see ipython/ipykernel@f40d74a

Can you check what version of IPyKernel version you have installed? Based on the line number of self.init_sockets() in you stack trace, I think you have <= 5.1.1.

Can you try updating the ipykernel package and try IPyIDA without the patch?

Cheers!

Cheers! This problem disappeared after I upgraded ipykernel.
In order to avoid the same problem from happening again in others, I suggest to modify https://github.com/eset/ipyida/blob/0fee04f327/setup.py#L32 to ipykernel>=5.1.4'

@marc-etienne
Copy link
Contributor

I added the requirement for Windows on Python >= 3.8.

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