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 bup
Recipients bup, paul.moore, steve.dower, tim.golden, zach.ware
Date 2018-09-10.11:57:43
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1536580663.47.0.56676864532.issue34620@psf.upfronthosting.co.za>
In-reply-to
Content
>>> b'\542\571\564\545\563', b'\142\171\164\145\163'
(b'bytes', b'bytes')

All the C compilers I know of at the very least generate a warning when one tries to assign an oct literal >= '\400' to a byte. And that's because it's nonsense when bytes have 8 bits, even more so for an 8 bit byte string.

The literal value:

>>> b'\542\571\564\545\563'

should be identical to:

>>> bytes([0o542, 0o571, 0o564, 0o545, 0o563])

That obviously doesn't work:

>>> b'\542\571\564\545\563' == bytes([0o542, 0o571, 0o564, 0o545, 0o563])
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: bytes must be in range(0, 256)

This is on Windows/Intel. I haven't looked at the parser in much detail, but I wonder what would happen on a big-endian system?
History
Date User Action Args
2018-09-10 11:57:43bupsetrecipients: + bup, paul.moore, tim.golden, zach.ware, steve.dower
2018-09-10 11:57:43bupsetmessageid: <1536580663.47.0.56676864532.issue34620@psf.upfronthosting.co.za>
2018-09-10 11:57:43buplinkissue34620 messages
2018-09-10 11:57:43bupcreate