Repository navigation
mockobject: Fix UpdateProperties for ObjectPath and Signature values - #252
Merged
Merged
Conversation
UpdateProperties() with one of these values failed with "AttributeError: 'dbus.ObjectPath' object has no attribute 'conjugate'", as only the numeric types have conjugate(). Their constructors all take an instance of their own type, so pass the value through as is. Signed-off-by: Lars Smith Eier <larssmitheier@protonmail.com>
martinpitt
approved these changes
Dec 2, 2026
martinpitt
left a comment
Owner
There was a problem hiding this comment.
Thanks! Also for the _wrap_in_dbus_variant hint -- I'd be happy to lose this if possible, I didn't look into the details yet though. Do you want to send another PR for that, or should I look into that myself?
Owner
|
@leierx actually, this sparked my interest now, I'll do a branch myself. After that I'll do a new release so you can use your two recent fixes. Cheers! |
Owner
Contributor
Author
|
Cool! 🚀 |
Owner
|
@leierx : https://github.com/martinpitt/python-dbusmock/releases/tag/0.38.2 . I uploaded that to Debian unstable and Fedora 44/45/rawhide. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
UpdatePropertieswith adbus.ObjectPath,dbus.Signatureordbus.ByteArrayvalue fails:_wrap_in_dbus_variantcallsvalue.conjugate(), which only the numeric types have (same bug as #239 for Struct/Dict).type(value)(value, variant_level=1)works for every type indbus_typesexceptUnixFd, which was already broken and stays so._wrap_in_dbus_variantitself looks redundant since c9567f3:EmitSignalruns_convert_args("sa{sv}as", ...), which wrapsa{sv}values in variants viaMessage.append(asbluez5.pyalready relies on). Passingpropertiesstraight toEmitSignaland dropping_wrap_in_dbus_variantalso makesUnixFdand plain Python types (int,bool,list, …) work from templates. Happy to switch to that if preferred.Test:
test_propertiesupdates anoand agproperty; fails before, passes after.