Skip to content
This repository has been archived by the owner on Apr 7, 2022. It is now read-only.

DevEncoded attribute should produce a bytes object in python 3 #214

Merged
merged 2 commits into from Sep 7, 2018

Conversation

vxgmichel
Copy link
Contributor

@vxgmichel vxgmichel commented Sep 6, 2018

Fix issue #213.

Copy link
Member

@ajoubertza ajoubertza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was a quick fix! Thanks for adding a test so we can see that it works. Just some minor notes, but looks good.

py_value.attr(value_attr_name) =
bopy::make_tuple(r_encoded_format, r_encoded_data);

boost::python::object r_encoded_data(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor, but this line's indentation looks different to the others in the github view. Maybe hard tab vs soft tab issue?

bopy::make_tuple(r_encoded_format, r_encoded_data);

boost::python::object r_encoded_data(
boost::python::handle<>(PyBytes_FromStringAndSize(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In other parts of this file with similar code uses bopy::handle<>, rather than boost::python::handle<>. E.g.

bopy::object w_encoded_data = bopy::object(bopy::handle<>(w_encoded_data_ptr));

I don't know what either do, so just checking if it makes a difference?

bopy::str w_encoded_data(w_ch_ptr, w_encoded_data_array.length());
py_value.attr(w_value_attr_name) =

boost::python::object w_encoded_data(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indentation differs here too.


@attr.write
def attr(self, value):
print(value)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this print still useful, or was it just to aid debugging?

@vxgmichel
Copy link
Contributor Author

@ajoubertza Thanks for the review, it's all fixed.

Copy link
Member

@ajoubertza ajoubertza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@vxgmichel
Copy link
Contributor Author

@ajoubertza Feel free to merge it then :)

@ajoubertza ajoubertza merged commit 66a68bb into develop Sep 7, 2018
@ajoubertza ajoubertza deleted the issue-213 branch September 7, 2018 13:48
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants