[issue17718] boolop constant checking for if/while

2013-04-13 Thread Stephen Tu
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_

[issue17708] sys.flags.hash_randomization doesn't return correct value

2013-04-13 Thread Stephen Tu
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

[issue17671] io.BufferedRWPair can use uninitialized members

2013-04-13 Thread Stephen Tu
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

[issue17575] HTTPConnection.send

2013-04-13 Thread Stephen Tu
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

[issue17671] io.BufferedRWPair can use uninitialized members

2013-04-13 Thread Stephen Tu
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

[issue17708] sys.flags.hash_randomization doesn't return correct value

2013-04-13 Thread Stephen Tu
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