615 def call_blocking(self, bus_name, object_path, dbus_interface, method,
616 signature, args, timeout=2.0,
617 byte_arrays=False, **kwargs):
618 """Call the given method, synchronously.
619 :Since: 0.81.0
620 """
621 if object_path == LOCAL_PATH:
622 raise DBusException('Methods may not be called on the reserved '
623 'path %s' % LOCAL_PATH)
624 if dbus_interface == LOCAL_IFACE:
625 raise DBusException('Methods may not be called on the reserved '
626 'interface %s' % LOCAL_IFACE)
627 # no need to validate other args - MethodCallMessage ctor will do
628
629 get_args_opts = dict(byte_arrays=byte_arrays)
630 if is_py2:
631 get_args_opts['utf8_strings'] = kwargs.get('utf8_strings', False )
632 elif 'utf8_strings' in kwargs:
633 raise TypeError("unexpected keyword argument 'utf8_strings'")
634
635 message = MethodCallMessage(destination=bus_name,
636 path=object_path,
637 interface=dbus_interface,
638 method=method)
639 # Add the arguments to the function
640 try:
641 message.append(signature=signature, *args)
642 except Exception as e:
643 logging.basicConfig()
644 _logger.error('Unable to set arguments %r according to '
645 'signature %r: %s: %s',
646 args, signature, e.__class__, e)
647 raise
648 # make a blocking call
649
650
651 print ("message : ",message)
652 print("timeout",timeout)
653
654 _logger.info ("message : ",message)
655 _logger.info("timeout",timeout)
657 print ("reply meaage : ",self.send_message_with_reply_and_block(
658 message, timeout))
659 _logger.info ("reply meaage : ",self.send_message_with_reply_and_blo ck(
660 message, timeout))
the program crash at this line.
Hello,
I tried to locking for the bug :
Here is my result :
In /usr/lib/ python3/ dist-packages/ dbus/proxies. py
615 def call_blocking(self, bus_name, object_path, dbus_interface, method, 'Methods may not be called on the reserved ' 'Methods may not be called on the reserved ' arrays= byte_arrays) opts['utf8_ strings' ] = kwargs. get('utf8_ strings' , False ) "unexpected keyword argument 'utf8_strings'")
616 signature, args, timeout=2.0,
617 byte_arrays=False, **kwargs):
618 """Call the given method, synchronously.
619 :Since: 0.81.0
620 """
621 if object_path == LOCAL_PATH:
622 raise DBusException(
623 'path %s' % LOCAL_PATH)
624 if dbus_interface == LOCAL_IFACE:
625 raise DBusException(
626 'interface %s' % LOCAL_IFACE)
627 # no need to validate other args - MethodCallMessage ctor will do
628
629 get_args_opts = dict(byte_
630 if is_py2:
631 get_args_
632 elif 'utf8_strings' in kwargs:
633 raise TypeError(
634 ge(destination= bus_name, dbus_interface, append( signature= signature, *args) basicConfig( ) error(' Unable to set arguments %r according to ' timeout" ,timeout) info("timeout" ,timeout)
635 message = MethodCallMessa
636 path=object_path,
637 interface=
638 method=method)
639 # Add the arguments to the function
640 try:
641 message.
642 except Exception as e:
643 logging.
644 _logger.
645 'signature %r: %s: %s',
646 args, signature, e.__class__, e)
647 raise
648 # make a blocking call
649
650
651 print ("message : ",message)
652 print("
653
654 _logger.info ("message : ",message)
655 _logger.
657 print ("reply meaage : ",self. send_message_ with_reply_ and_block( send_message_ with_reply_ and_blo ck(
658 message, timeout))
659 _logger.info ("reply meaage : ",self.
660 message, timeout))
the program crash at this line.
661 reply_message = self.send_ message_ with_reply_ and_block( message_ with_reply_ and_block( message, time out) get_args_ list(** get_args_ opts)
662 message, timeout)
663 # reply_message = self.send_
664 args_list = reply_message.
665 if len(args_list) == 0:
666 return None
667 elif len(args_list) == 1:
668 return args_list[0]
669 else:
670 return tuple(args_list)
this lines is never execute :
128 print ("poxis ignore_reply : ",ignore_reply ) n.call_ async(self. _named_ service,
129 print ("proxis reply_handler : ",reply_handler)
130 if ignore_reply or reply_handler is not None:
131 self._connectio
132 self._object_path,
133 dbus_interface,
134 self._method_name,
135 signature,
136 args,
137 reply_handler,
138 error_handler,
139 **keywords)
140 else:
this lines is always execute :
141 return self._connectio n.call_ blocking( self._named_ service,
142 self._object_path,
143 dbus_interface,
144 self._method_name,
145 signature,
146 args,
147 **keywords)
the async call is never execute, Is is not possible in this case ? message_ with_reply_ and_block(
661 reply_message = self.send_
662 message, timeout)
U hop I can help to solve this issues
Best regards
Battant