[issue4806] Function calls taking a generator as star argument can mask TypeErrors in the generator

2015-02-23 Thread Martin Panter
Martin Panter added the comment: I am posting a new version of Daniel’s patch as issue4806-star-TypeError.v2.patch: * Merged with recent “default” (3.5) branch * Dropped the documentation fix, since revision a8aa918041c2 already fixed that in an identical fashion * Changed to a “look before yo

[issue23505] Urlparse insufficient validation leads to open redirect

2015-02-23 Thread Yassine ABOUKIR
New submission from Yassine ABOUKIR: The module urlparse lacks proper validation of the input leading to open redirect vulnerability. The issue is that URLs do not survive the round-trip through `urlunparse(urlparse(url))`. Python sees `/foo.com` as a URL with no hostname or scheme and a

[issue23504] Add __all__ into types

2015-02-23 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: Currently pydoc outputs only two classes and two functions in the types module. Proposed patch add __all__ into the types module, so that pydoc will output builtin class deliberately added into the types module. -- components: Library (Lib) files:

[issue3566] httplib persistent connections violate MUST in RFC2616 sec 8.1.4.

2015-02-23 Thread Demian Brecht
Demian Brecht added the comment: Pending review of the exceptions from another core dev, the patch looks good to me. Thanks for sticking with it :) -- ___ Python tracker ___

[issue15955] gzip, bz2, lzma: add option to limit output size

2015-02-23 Thread Martin Panter
Martin Panter added the comment: Rev3 still seems to have the same weird indentation as rev2. Are you using some sort of diff --ignore-all-space option by accident? -- ___ Python tracker __

[issue23314] Disabling CRT asserts in debug build

2015-02-23 Thread Steve Dower
Steve Dower added the comment: You're right, SuppressCrashReport also makes more sense here, though it still needs to be used explicitly in every new process. New patch attached. -- Added file: http://bugs.python.org/file38210/23314_tf_inhert_check_2.diff __

[issue23496] Steps for Android Native Build of Python 3.4.2

2015-02-23 Thread Cyd Haselton
Changes by Cyd Haselton : Removed file: http://bugs.python.org/file38209/python-3.4.2-androidpatches-1.tar.gz ___ Python tracker ___ ___ Pyth

[issue23496] Steps for Android Native Build of Python 3.4.2

2015-02-23 Thread Cyd Haselton
Cyd Haselton added the comment: Apologies for the tarball, but all patches within are related to this "issue" Removing tarball and will re-post individual, cleaned-up patches, grouped by issue. Ryan, can you re-do patch for pythonrun.c? If not. I'l. work it in. -- _

[issue23314] Disabling CRT asserts in debug build

2015-02-23 Thread STINNER Victor
STINNER Victor added the comment: 23314_tf_inherit_check.diff: I would prefer to see this complex code in a function of the support module. For example, the SuppressCrashReport class is a good candidate. -- ___ Python tracker

[issue23496] Steps for Android Native Build of Python 3.4.2

2015-02-23 Thread STINNER Victor
STINNER Victor added the comment: It's not convinient to have patches in a tarball. Please at least open patches one by one, or better: open one issue per patch. You should group similar changes in a single patch: for example all changes related to wcstombs(). You should explain each change.

[issue23496] Steps for Android Native Build of Python 3.4.2

2015-02-23 Thread Cyd Haselton
Cyd Haselton added the comment: The attached g-zipped file contains the first set of patches required to build Python 3.4.2 from source in the environment specified in the origonal post. Will post the second/final set ASAP -- Added file: http://bugs.python.org/file38209/python-3.4.2-a

[issue10128] multiprocessing.Pool throws exception with __main__.py

2015-02-23 Thread Marc Schlaich
Marc Schlaich added the comment: Please fix this. Scripts with multiprocessing bundled as wheels are broken with Python 2.7 on Windows: https://github.com/pypa/pip/issues/1891 -- nosy: +schlamar ___ Python tracker

[issue23493] optimize sort_keys in json module by using operator.itemgetter()

2015-02-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Could you measure the effect on json.encode()? -- ___ Python tracker ___ ___ Python-bugs-list mail

[issue23493] optimize sort_keys in json module by using operator.itemgetter()

2015-02-23 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- status: languishing -> open ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: ht

[issue23493] optimize sort_keys in json module by using operator.itemgetter()

2015-02-23 Thread Wouter Bolsterlee
Wouter Bolsterlee added the comment: Using IPython and CPython 3.4: >>> d = dict.fromkeys(map(str, range(1000))) Current implementation: >>> %timeit sorted(d.items(), key=lambda kv: kv[0]) 1000 loops, best of 3: 605 µs per loop >>> %timeit sorted(d.items(), key=lambda kv: kv[0]) 1000 loops, b

[issue23493] optimize sort_keys in json module by using operator.itemgetter()

2015-02-23 Thread STINNER Victor
STINNER Victor added the comment: "My interpretation of the results. In CPython using operator.itemgetter() makes sorting up to 2 times faster" If I remember correctly, Python functions implemented in C don't create a Python frame. The Python frame is an important cost in term of performances.

[issue23493] optimize sort_keys in json module by using operator.itemgetter()

2015-02-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: My interpretation of the results. In CPython using operator.itemgetter() makes sorting up to 2 times faster (only 25% faster with string keys), in PyPy it make sorting slightly slower (because operator.itemgetter() is implemented in Python, but the lambda is

[issue23493] optimize sort_keys in json module by using operator.itemgetter()

2015-02-23 Thread STINNER Victor
STINNER Victor added the comment: > That said, it is applied only n-times and is likely insignificant when > compared to the O(n log n) sort. (...) 904 usec => 462 usec is very significant: it's 49% faster. So I'm ok for the change. Note: PyPy JIT may not be able to optimize operator.itemgett

[issue23493] optimize sort_keys in json module by using operator.itemgetter()

2015-02-23 Thread STINNER Victor
STINNER Victor added the comment: Oh, forget my comment. sorted() never changes the input list, so the microbenchmark is ok. -- ___ Python tracker ___ __

[issue23493] optimize sort_keys in json module by using operator.itemgetter()

2015-02-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Unless we use recent PyPy with ordered dicts. -- ___ Python tracker ___ ___ Python-bugs-list maili

[issue23493] optimize sort_keys in json module by using operator.itemgetter()

2015-02-23 Thread STINNER Victor
STINNER Victor added the comment: If I remember correctly, the complexity and performance of sort/sorted depends if the data set is sorted or not. You may recreated the list/dictionary at each iteration to get performances closer to "items = sorted(dct.items(), key=lambda kv: kv[0])" (dict key

[issue23493] optimize sort_keys in json module by using operator.itemgetter()

2015-02-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: CPython: $ python3.4 -m timeit -s 'f = lambda kv: kv[0]' -s 's = list(dict.fromkeys(range(1000)).items())' -- 'sorted(s, key=f)' 1000 loops, best of 3: 904 usec per loop $ python3.4 -m timeit -s 'import operator' -s 'f = operator.itemgetter(0)' -s 's = list(

[issue23245] urllib2: urlopen() gets exception(kwargs bug?)

2015-02-23 Thread Douman
Douman added the comment: Just to up issue. It seems that there is some changes in 2.7.9 that breaks usage of urllib2.urlopen() -- ___ Python tracker ___ ___

[issue23488] Random objects twice as big as necessary on 64-bit builds

2015-02-23 Thread STINNER Victor
STINNER Victor added the comment: The patch looks good to me. For utint32_t, see my old issue #17884: "Try to reuse stdint.h types like int32_t". -- ___ Python tracker ___

[issue23484] SemLock acquire() keyword arg 'blocking' is invalid

2015-02-23 Thread Teodor Dima
Teodor Dima added the comment: >>> Of course, there's code in the wild that expects and uses the parameter >>> named 'block' so simply changing this keyword will result in breaking >>> others' code. That is, indeed, the case with my company's code as well. --

[issue23488] Random objects twice as big as necessary on 64-bit builds

2015-02-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Some microbenchmark results on 32-bit Linux: $ ./python -m timeit -s "from random import getrandbits" -- "getrandbits(64)" Before: 100 loops, best of 3: 1.41 usec per loop After: 100 loops, best of 3: 1.34 usec per loop $ ./python -m timeit -s "from

[issue23488] Random objects twice as big as necessary on 64-bit builds

2015-02-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Oh, sorry, here is it. -- keywords: +patch Added file: http://bugs.python.org/file38208/random_uint32.patch ___ Python tracker ___ ___