Hi I just found a bug when reading recordings using a with context. With a simple sample like so:
from pyk4a import PyK4APlayback
with PyK4APlayback("recording.mkv") as p: # call __enter__
while True:
try:
p.get_next_capture()
# do stuff
except EOFError:
break # get out of the with statement -> call __exit__
Upon exiting the with statement I get TypeError: __exit__() takes 1 positional argument but 4 were given. Which is actually normal because it takes 4 even if the others may be None.
So I guess it's a simple fix, __exit__(self) just needs to be replaced by __exit__(self, exc_type, exc_value, traceback). I did it locally and it works just fine!
Hi I just found a bug when reading recordings using a
with
context. With a simple sample like so:Upon exiting the with statement I get
TypeError: __exit__() takes 1 positional argument but 4 were given
. Which is actually normal because it takes 4 even if the others may beNone
. So I guess it's a simple fix,__exit__(self)
just needs to be replaced by__exit__(self, exc_type, exc_value, traceback)
. I did it locally and it works just fine!