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-28.03:16:33
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1469675794.03.0.670594202487.issue27637@psf.upfronthosting.co.za>
In-reply-to
Content
Oops.

def serialize(value: int, signed=True) -> bytes:
    x = value.to_bytes(-1, 'big', signed=signed)
    l = len(x).to_bytes(4, 'big', signed=False)
    return l + x

assert len(serialize(0)) == 4 + 0 # see Issue27623
assert len(serialize(120)) == 4 + 1
assert len(serialize(130)) == 4 + 2
assert len(serialize(130), False) == 4 + 1
History
Date User Action Args
2016-07-28 03:16:34socketpairsetrecipients: + socketpair
2016-07-28 03:16:34socketpairsetmessageid: <1469675794.03.0.670594202487.issue27637@psf.upfronthosting.co.za>
2016-07-28 03:16:34socketpairlinkissue27637 messages
2016-07-28 03:16:33socketpaircreate