Danny Yoo added the comment:
Alternatively, change the representation of flag values from integers to some
class extension that supports the common bitwise operators.
As a very rough sketch:
>>> class FlagInt(int):
... def __or__(self, other):
... return FlagInt(int(se
Danny Yoo added the comment:
Ugh. I suddenly realize that this is complicated by the fact that flag values
are themselves represented as integers, and Python's type system isn't rich
enough to label flag values as a distinct type for the purposes.
It may be worthwhile to add a warn
New submission from Danny Yoo:
This comes from diagnosing a beginner's question on Python-tutor.
https://mail.python.org/pipermail/tutor/2016-December/110066.html
It appears that re.sub is not checking whether the count argument is integer or
not, and silently accepts a nonsensical arg
Changes by Danny Yoo :
--
title: zlib.crc32 raises OverflowError at argument-parsing time on large
strings -> Within zipfile, use of zlib.crc32 raises OverflowError at
argument-parsing time on large strings
___
Python tracker
&l
Danny Yoo added the comment:
Unfortunately, fixing just zlib.crc32 isn't quite enough for our purposes. We
still will see OverflowErrow in zipfile if compression is selected.
Demonstration code:
import zipfile
## Possible workaround: m
New submission from Danny Yoo:
Reproduction steps:
---
$ python2.7 -c "import zlib;zlib.crc32('a'*(1<<31))"
Traceback (most recent call last):
File "", line 1, in
OverflowError: size does not fit in an int
---
We ran into this bug in zlib.crc32 when