Skip to content
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

Confirm integer marhsalling/unmarshalling #73

Open
exvito opened this issue Jul 7, 2017 · 2 comments
Open

Confirm integer marhsalling/unmarshalling #73

exvito opened this issue Jul 7, 2017 · 2 comments

Comments

@exvito
Copy link
Collaborator

exvito commented Jul 7, 2017

Creating this ticket as a follow-up of a not 100% clear matter identified in #65 (comment).

Facts:

  • DBus has several int types, singed/unsigned, from 8- to 64- bit wide.
  • Python 3 unified Python int and longs into a common int. In either case, these are arbitrariliy long and may not fit in a 64-bit wide representation.
  • With Python 3 support #11 and associated tickets some changes have been made which may affect this.

What I'm trying to account for:

  • This code appropriately marshals/unmarshals whichever ints (or longs, in Python 2) into the appropriate DBus types or "fails" in a documented way (i.e.: when marshalling a value that does not fit the destination DBus type).

Maybe this is all correct, maybe not. Just leaving this here for future reference and to be checked by someone (me, who knows?) in the future.

Plan:

  • Ensure tests exist for all combinations of DBus integer types and valid/invalid Python integers for each of those.
@WhyNotHugo
Copy link
Collaborator

To sum up a bit:

  • We'll need different code paths on py2 vs py3
  • On py3: always use int.
  • On py2, use long or int (is there anything wrong with always using long?)
  • In the value is over 64-bit wide, raise ValueError.

@exvito
Copy link
Collaborator Author

exvito commented Jul 14, 2017

Quick note: related to #19.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants