Stephen Tu added the comment:
But it would seem that setting PYTHONHASHSEED != "random" does disable hash
randomization. also, not sure what the semantics of the following is:
$ PYTHONHASHSEED=1 python -R ...
right now, python3 basically
Stephen Tu added the comment:
patch with test in test_io
--
Added file: http://bugs.python.org/file29835/bufferedio.withtest.patch
___
Python tracker
<http://bugs.python.org/issue17
Stephen Tu added the comment:
I don't think this is a bug anymore in the codebase- looking at
Lib/http/client.py, if hasattr(data, "read") is true, then the branch will
return unconditionally.
if hasattr(data, "read") :
if self.debuglevel &g
Stephen Tu added the comment:
_forward_call() now checks if reader/write is NULL- if so, throws a runtime
exception
--
keywords: +patch
nosy: +Stephen.Tu
Added file: http://bugs.python.org/file29814/bufferedio.patch
___
Python tracker
<h
Stephen Tu added the comment:
Py_HashRandomizationFlag was not getting properly set anywhere. This patch
fixes this. Also a test case
Behavior is now:
$ cat ~/hr.py
import sys
print(sys.flags.hash_randomization)
$ PYTHONHASHSEED=random ./python.exe ~/hr.py
1
$ PYTHONHASHSEED=0 ./python.exe
New submission from Stephen Tu:
Here's a simple patch to optimize away constant boolean
conjunctions/disjunctions. for example:
def foo():
if 1 and 0:
print("hi")
now disassembles into:
7 0 LOAD_CONST 0 (None)
3 RETURN_