python-pulse-control icon indicating copy to clipboard operation
python-pulse-control copied to clipboard

PyPy3 errors: TypeError: expected integer, got NoneType object

Open sbraz opened this issue 3 years ago • 3 comments

When I run tests with PyPy3, they pass but I see a lot of these errors. Is PyPy3 officially supported? For instance:

$ pypy3 -m unittest discover -k test_default_set
TypeError: expected integer, got NoneType object
TypeError: expected integer, got NoneType object
TypeError: expected integer, got NoneType object
TypeError: expected integer, got NoneType object
TypeError: expected integer, got NoneType object
TypeError: expected integer, got NoneType object
TypeError: expected integer, got NoneType object
TypeError: expected integer, got NoneType object
TypeError: expected integer, got NoneType object
TypeError: expected integer, got NoneType object
TypeError: expected integer, got NoneType object
TypeError: expected integer, got NoneType object
TypeError: expected integer, got NoneType object
TypeError: expected integer, got NoneType object
TypeError: expected integer, got NoneType object
TypeError: expected integer, got NoneType object
TypeError: expected integer, got NoneType object
TypeError: expected integer, got NoneType object
TypeError: expected integer, got NoneType object
TypeError: expected integer, got NoneType object
TypeError: expected integer, got NoneType object
TypeError: expected integer, got NoneType object
TypeError: expected integer, got NoneType object
TypeError: expected integer, got NoneType object
TypeError: expected integer, got NoneType object
TypeError: expected integer, got NoneType object
TypeError: expected integer, got NoneType object
.
----------------------------------------------------------------------
Ran 1 test in 0.904s

OK

sbraz avatar May 14 '21 19:05 sbraz

Don't think I've ever tried running the thing on it, but don't see why it shouldn't work there, and unless it needs some major rewrite, can probably fix bugs there.

That output without proper exception is weird though, like a print() forgotten somewhere :)

mk-fg avatar May 14 '21 19:05 mk-fg

I suspect something related to ctypes but I don't really know what.

sbraz avatar May 14 '21 19:05 sbraz

Yeah, probably.

Putting print()s around this very first ctypes call:

try: c.pa.context_connect(self._ctx, self.server, flags, None)
except c.pa.CallError: self.connected = False

...already traps one of those.

But looking at wrappers and replacing None there with POINTER(c_int)() doesn't seem to help. And adding a bunch more prints seem to narrow it down to "somewhere in pypy3 ctypes", so idk, maybe they'll fix it upstream, or maybe there's some pypy-specific debug option enabled by design producing these, but too lazy to look into these within pypy code or report it there.

If someone has any idea where these things come from, please leave a comment.

mk-fg avatar May 14 '21 20:05 mk-fg