This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author socketpair
Recipients socketpair
Date 2016-07-26.06:26:20
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1469514380.74.0.642597369558.issue27623@psf.upfronthosting.co.za>
In-reply-to
Content
As you can see, these conversions are not consistent. What is use case to allow that?

===================

In [22]: (-1).to_bytes(0, 'big', signed=True)
Out[22]: b''

In [23]: (0).to_bytes(0, 'big', signed=True)
Out[23]: b''

As you can see, two different values serialized to same  empty bytes sequence.

===================

In [28]: int.from_bytes(b'', 'big', signed=True)
Out[28]: 0

In [29]: int.from_bytes(b'', 'big', signed=False)
Out[29]: 0

Anyway, -1 can not be deserialized.

===================
History
Date User Action Args
2016-07-26 06:26:20socketpairsetrecipients: + socketpair
2016-07-26 06:26:20socketpairsetmessageid: <1469514380.74.0.642597369558.issue27623@psf.upfronthosting.co.za>
2016-07-26 06:26:20socketpairlinkissue27623 messages
2016-07-26 06:26:20socketpaircreate