pfalcon / pycopy-lib

Standard library of the Pycopy project, minimalist and light-weight Python language implementation
https://github.com/pfalcon/pycopy
Other
246 stars 70 forks source link

uasyncio: Fixed bug in uasyncio.remove_writer #27

Closed h3po closed 5 years ago

h3po commented 5 years ago

uselect.Epoll.unregister takes only one argument. I don't know what this code does and how it works (just started to use micropython) but I had to change this to make picoweb work.

pfalcon commented 5 years ago

You're using outdated MicroPython. Please read the docs: https://pypi.org/project/micropython-uasyncio/

h3po commented 5 years ago

i built it yesterday from pfalcon/micropython master branch. uasyncio and uselect from pypi edit: ah, you're not using master. i see.

pfalcon commented 5 years ago

master is upstream, i.e. micropython/micropython. You need to build from the default branch of the repo, which you get when you git clone https://github.com/pfalcon/micropython

h3po commented 5 years ago

yeah i was using a specific commit so i could build a release tag or latest. it just didn't occur to me that latest ist not master in this case. I made a dockerfile to compile and run the unix port on a lightweight alpine image: https://github.com/h3po/docker-micropython

h3po commented 5 years ago

I'm getting the same error with the pfalcon branch. Why do you think my micropython version is to blame?

micropython-lib/select/select.py

    def unregister(self, fd):

micropython-lib/uasyncio/uasyncio/init.py

    def remove_reader(self, sock):
    [...]
    self.poller.unregister(sock)

    def remove_writer(self, sock):
    [...]
    self.poller.unregister(sock, False)
pfalcon commented 5 years ago

Because it's a known issue, hitting users not following the instructions, e.g. https://github.com/pfalcon/picoweb/issues/45 .

Rather, you would need to explain why you think it's related to micropython-lib/select/select.py . And to be able to do something about this, there should be clear instructions how to reproduce it.