sequoia-ptpy
sequoia-ptpy copied to clipboard
Lambda missing 1 required positional argument: 'lst'
Hello,
(this issue is very similar to #20 but I decided to make a new one because it was quite old.)
I cannot connect to my Nikon d7200 via IP using the library. Here's my code:
from ptpy import PTPy
from ptpy.transports.ip import IPTransport
c = PTPy(transport=IPTransport, device='192.168.1.1')
The ip address is correct, since another (but less sophisticated) library is able to connect with the same address. The error I get is:
E 65729 ptpy.transports.ip[MainThread:__implicit_session:115] <lambda>() missing 1 required positional argument: 'lst'
E 65729 ptpy.ptp[MainThread:recv:801] Failed to open PTP/IP implicit session
Traceback (most recent call last):
File "/home/kaappo/.local/lib/python3.7/site-packages/ptpy/transports/ip.py", line 111, in __implicit_session
self.__open_implicit_session()
File "/home/kaappo/.local/lib/python3.7/site-packages/ptpy/transports/ip.py", line 136, in __open_implicit_session
self.__setup_connection(self.__device)
File "/home/kaappo/.local/lib/python3.7/site-packages/ptpy/transports/ip.py", line 208, in __setup_connection
Minor=000,
File "/home/kaappo/.local/lib/python3.7/site-packages/construct/core.py", line 203, in build
self.build_stream(obj, stream, context, **kw)
File "/home/kaappo/.local/lib/python3.7/site-packages/construct/core.py", line 215, in build_stream
self._build(obj, stream, context, "building")
File "/home/kaappo/.local/lib/python3.7/site-packages/construct/core.py", line 299, in _build
return self.subcon._build(obj, stream, context, path)
File "/home/kaappo/.local/lib/python3.7/site-packages/construct/core.py", line 874, in _build
buildret = sc._build(subobj, stream, context, path)
File "/home/kaappo/.local/lib/python3.7/site-packages/construct/core.py", line 2704, in _build
return self.subcon._build(obj, stream, context, path)
File "/home/kaappo/.local/lib/python3.7/site-packages/construct/core.py", line 315, in _build
return self.subcon._build(self._encode(obj, context), stream, context, path)
File "/home/kaappo/.local/lib/python3.7/site-packages/construct/core.py", line 1133, in _build
if self.predicate(subobj, context):
TypeError: <lambda>() missing 1 required positional argument: 'lst'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/kaappo/.local/lib/python3.7/site-packages/ptpy/__init__.py", line 114, in __new__
device_info = plain_camera.get_device_info()
File "/home/kaappo/.local/lib/python3.7/site-packages/ptpy/ptp.py", line 953, in get_device_info
response = self.recv(ptp)
File "/home/kaappo/.local/lib/python3.7/site-packages/ptpy/ptp.py", line 802, in recv
raise e
File "/home/kaappo/.local/lib/python3.7/site-packages/ptpy/ptp.py", line 799, in recv
return super(PTP, self).recv(ptp_container)
File "/home/kaappo/.local/lib/python3.7/site-packages/ptpy/transports/ip.py", line 600, in recv
with self.__implicit_session():
File "/usr/lib/python3.7/contextlib.py", line 112, in __enter__
return next(self.gen)
File "/home/kaappo/.local/lib/python3.7/site-packages/ptpy/transports/ip.py", line 116, in __implicit_session
raise PTPError('Failed to open PTP/IP implicit session')
ptpy.ptp.PTPError: Failed to open PTP/IP implicit session
I'm having a very similar problem with the Parrot Sequoia, running on the latest master. I verified the camera and network connection using the HTTP control API, which works fine. But the PTP API does not work:
Here's my code:
#!/usr/bin/env python
from ptpy import PTPy
from ptpy.transports.ip import IPTransport
# Default PTP/IP port assumed
c = PTPy(transport=IPTransport, device='192.168.47.1')
And there's the output I'm getting:
E 14 ptpy.transports.ip[MainThread:__implicit_session:115] <lambda>() takes exactly 3 arguments (2 given)
E 14 ptpy.ptp[MainThread:recv:809] Failed to open PTP/IP implicit session
Traceback (most recent call last):
File "./test.py", line 6, in <module>
c = PTPy(transport=IPTransport, device='192.168.47.1')
File "build/bdist.linux-x86_64/egg/ptpy/__init__.py", line 116, in __new__
File "build/bdist.linux-x86_64/egg/ptpy/ptp.py", line 969, in get_device_info
File "build/bdist.linux-x86_64/egg/ptpy/ptp.py", line 810, in recv
ptpy.ptp.PTPError: Failed to open PTP/IP implicit session
Have u guys fixed this? Could u share some ideas?
Well, this repo seems to be dead.
I'm having the same problem attempting to connect to a Panasonic BGH1 from a Mac running 10.14.5. Sigh. Doesn't look like anyone has made any progress on this issue in a very long time.
I ran into this too, it seems fixable by upgrading construct to a later version on the 2.8 branch, I used 2.8.22.