-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
marshal.sigFromPy assumes all python ints to be 'i', which is not the case... #40
Comments
For the short term, is there a way for me to return pre-marshaled variants? Example: |
This causes another issue: when calling a remote method that has a uint32 signature txdbus infers that the value is int32 and replaces the variant signature with "i" as instead of "u". Possible fixes may be:
sigFromPy already has a mechanism to extract explicit signature but I can't see that it works with RemoteDBusObject.callRemote()
I thought this was easy and tried to pass the signature explicitly to RemoteDBusObject.objHandler.conn.callRemote() but got an error:
since DBus.Properties.Set requires a ssv signature. I could implement either of these solutions or any other but some guiding would be really helpful :) |
Hmmm. The callRemote method on the client connection supports an explicit
signature definition and the callRemote method on the remote object
wrappers use client connection's version to actually invoke the remote
call. The signatures used by the wrappers come exclusively from the
interface list at the moment so it sounds like you'd like to be able to
pass an optional dbus_signature="..." argument to act as an explicit
override? That seems reasonable and should be pretty easy to implement.
Tom
…On Tue, Dec 20, 2016 at 10:43 AM, Gardar Hauksson ***@***.***> wrote:
This causes another issue: when calling a remote method that has a uint32
signature txdbus infers that the value is int32 and replaces the variant
signature with "i" as instead of "u". Possible fixes may be:
1. Provide a way to pass wrapped primitives to callRemote, e.g.:
class WrappedPrimitive(object): def __init__(self, val, sig): self.val =
val self.sig = sig
sigFromPy already has a mechanism to extract explicit signature but I
can't see that it works with RemoteDBusObject.callRemote()
1. Allow explicit signature definition from callRemote().
I thought this was easy and tried to pass the signature explicitly to
RemoteDBusObject.objHandler.conn.callRemote() but got an error:
RemoteError: org.freedesktop.DBus.Error.UnknownMethod: Method "Set" with
signature "ssu" on interface "org.freedesktop.DBus.Properties" doesn't
exist
since DBus.Properties.Set requires a ssv signature.
I could implement either of these solutions or any other but some guiding
would be really helpful :)
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#40 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ABrLfMjpsbeQPVoo2F2Zc0qFk_duiFKzks5rKAW6gaJpZM4JVcDU>
.
|
I have noticed several errors when I try to return a large int from a dbus method who's return signature is a variant or dictionary of variants. Python ints are C longs, and can contain larger values than will fit in 'i'. A simple size check for integers in sigFromPy would be easy to implement and solve this problem. A less elegant solution would be to change the default assignment to 'x', but that would result in larger messages in many cases.
The text was updated successfully, but these errors were encountered: