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 Carl.Friedrich.Bolz
Recipients Carl.Friedrich.Bolz
Date 2009-09-29.14:35:56
SpamBayes Score 1.6912878e-07
Marked as misclassified No
Message-id <1254234959.01.0.461220036741.issue7019@psf.upfronthosting.co.za>
In-reply-to
Content
When unmarshalling a hand-written string it is possible to break the
invariants of longs:

Python 2.6.2 (release26-maint, Apr 19 2009, 01:56:41)
[GCC 4.3.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> x = marshal.loads('l\x02\x00\x00\x00\x00\x00\x00\x00')
>>> print x
00000
>>> x == 0
False
>>> bool(x)
True
>>> x + 1
1L

I would expect this to raise an error instead.
History
Date User Action Args
2009-09-29 14:35:59Carl.Friedrich.Bolzsetrecipients: + Carl.Friedrich.Bolz
2009-09-29 14:35:59Carl.Friedrich.Bolzsetmessageid: <1254234959.01.0.461220036741.issue7019@psf.upfronthosting.co.za>
2009-09-29 14:35:57Carl.Friedrich.Bolzlinkissue7019 messages
2009-09-29 14:35:57Carl.Friedrich.Bolzcreate