[issue31108] add __contains__ for list_iterator (and others) for better performance

2017-08-31 Thread Raymond Hettinger
Raymond Hettinger added the comment: I recommend rejecting this proposal -- ___ Python tracker ___ ___ Python-bugs-list mailing list U

[issue31108] add __contains__ for list_iterator (and others) for better performance

2017-08-31 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- resolution: -> rejected stage: patch review -> resolved status: open -> closed ___ Python tracker ___ __

[issue26669] time.localtime(float("NaN")) does not raise a ValueError on all platforms

2017-08-31 Thread STINNER Victor
STINNER Victor added the comment: I like PR 3085 to raise explicitly a ValueError with an helpful error message. -- nosy: +haypo ___ Python tracker ___ __

[issue31312] Build differences caused by the time stamps

2017-08-31 Thread Wayland Zhong
New submission from Wayland Zhong: When I build python (version 2.7.13), I find the build results are different every time. It seems to be caused by some times tamps, and they may be generated by the code below: Lib/py_compile.py:106: with open(file, 'U') as f: Lib/py_compile.py:107:

[issue31313] Feature Add support of os.chflags() on Linux platform

2017-08-31 Thread Марк Коренберг
New submission from Марк Коренберг: Yes, chflags() is not supported by linux directly. But actually, Linux supports chflags functionality: https://stackoverflow.com/questions/34176464/why-os-chflags-doesnt-work-under-linux through ioctl (fd, EXT2_IOC_SETFLAGS, ) -- components: Librar

[issue31314] email throws exception with oversized header input

2017-08-31 Thread Matthias Klose
New submission from Matthias Klose: [forwarded from https://bugs.debian.org/854001] $ cat tst.py #!/usr/bin/env python import sys import email mail = email.message_from_string( """From: To: Subject: demo X-Overlong-Header-Name-causes-python-mail-to-crash-in-re-serialization-example: Hello ""

[issue27794] setattr a read-only property; the AttributeError should show the attribute that failed

2017-08-31 Thread Muhammad Alkarouri
Muhammad Alkarouri added the comment: Now that the descriptor protocol has `__set_name__`, does this make any difference to this issue? The property can know its name, subject to a suitable patch. -- nosy: +Muhammad Alkarouri ___ Python tracker

[issue31313] Feature Add support of os.chflags() on Linux platform

2017-08-31 Thread Antoine Pitrou
Antoine Pitrou added the comment: Judging by the ioctl name, this is ext2/ext3/ext4 specific? -- nosy: +larry, neologix, pitrou versions: -Python 3.6 ___ Python tracker ___

[issue31307] ConfigParser.read silently fails if filenames argument is a byte string

2017-08-31 Thread Henk-Jaap Wagenaar
Changes by Henk-Jaap Wagenaar : -- nosy: +Henk-Jaap Wagenaar ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: ht

[issue31312] Build differences caused by the time stamps

2017-08-31 Thread R. David Murray
R. David Murray added the comment: Duplicate of issue 29708. -- nosy: +r.david.murray resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> support reproducible Python builds type: security -> behavior ___ Python tracker

[issue29708] support reproducible Python builds

2017-08-31 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +haypo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python

[issue31311] a SystemError and a crash in PyCData_setstate() when __dict__ is bad

2017-08-31 Thread Oren Milman
Changes by Oren Milman : -- title: SystemError raised by PyCData_setstate() in case __dict__ is not a dict -> a SystemError and a crash in PyCData_setstate() when __dict__ is bad ___ Python tracker ___

[issue26826] Expose new copy_file_range() syscall in os module.

2017-08-31 Thread desbma
Changes by desbma : -- nosy: +desbma ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/ma

[issue31250] test_asyncio leaks dangling threads

2017-08-31 Thread STINNER Victor
STINNER Victor added the comment: I proposed PR 3252 to only fix unit tests, but not asyncio. An alternative is to modify BaseEventLoop.close() to replace executor.shutdown(wait=False) with executor.shutdown(wait=True), but it would change the behaviour. I'm not sure if we want to wait until a

[issue31250] test_asyncio leaks dangling threads

2017-08-31 Thread STINNER Victor
Changes by STINNER Victor : -- pull_requests: +3296 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mai

[issue31249] test_concurrent_futures leaks dangling threads

2017-08-31 Thread STINNER Victor
Changes by STINNER Victor : -- pull_requests: +3297 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mai

[issue31217] test_code leaked [1, 1, 1] memory blocks on x86 Gentoo Refleaks 3.6/3.x

2017-08-31 Thread STINNER Victor
STINNER Victor added the comment: Another command to reproduce a leak: ./python -m test -R 3:3 -j1 test_sys -F -m test.test_sys.SysModuleTest.test_current_frames -- ___ Python tracker

[issue31311] a SystemError and a crash in PyCData_setstate() when __dict__ is bad

2017-08-31 Thread Oren Milman
Changes by Oren Milman : -- pull_requests: +3298 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.p

[issue31311] a SystemError and a crash in PyCData_setstate() when __dict__ is bad

2017-08-31 Thread Oren Milman
Changes by Oren Milman : -- pull_requests: +3299 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.p

[issue31311] a SystemError and a crash in PyCData_setstate() when __dict__ is bad

2017-08-31 Thread Oren Milman
Changes by Oren Milman : -- components: +ctypes -Extension Modules ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscrib

[issue31315] assertion failure in imp.create_dynamic(), when spec.name is not a string

2017-08-31 Thread Oren Milman
New submission from Oren Milman: The following code causes an assertion failure in get_encoded_name(), which is called by _PyImport_LoadDynamicModuleWithSpec() (in Python/importdl.c): import imp class BadSpec: name = 42 origin = 'foo' imp.create_dynamic(BadSpec()) this is because _Py

[issue31217] test_code leaked [1, 1, 1] memory blocks on x86 Gentoo Refleaks 3.6/3.x

2017-08-31 Thread STINNER Victor
STINNER Victor added the comment: Current status of my analysis. I'm able to reproduce the bug using this modified Lib/test/test_sys.py: --- import unittest, test.support from test.support.script_helper import assert_python_ok import threading def f123(): pass class SysModuleTest(unittest.

[issue31316] Frequent *** stack smashing detected *** with Python 3.6.2/meinheld WSGI server

2017-08-31 Thread Andreas Jung
New submission from Andreas Jung: We are currently testing Python 3.6.2 with a BottlePY based with "meinheld" WSGI server and we see frequently these crashesis this related to Python or meinheld in particular? Linux unknown-device 4.7.0-1-amd64 #1 SMP Debian 4.7.2-1 (2016-08-28) x86_64 GN

[issue29707] os.path.ismount() always returns false for mount --bind on same filesystem

2017-08-31 Thread Alex Richman
Alex Richman added the comment: Can confirm, ran into this issue. It's because os.path.ismount() works by checking if the path's parent is on a different device (e.g. st_dev is the same for 'path/' and 'path/..'), which obviously it is for a bind mount on the same filesystem. It is actually

[issue31315] assertion failure in imp.create_dynamic(), when spec.name is not a string

2017-08-31 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- nosy: +brett.cannon, eric.snow, ncoghlan, serhiy.storchaka ___ Python tracker ___ ___ Python-bugs-lis

[issue30940] Documentation for round() is incorrect.

2017-08-31 Thread Roundup Robot
Changes by Roundup Robot : -- pull_requests: +3300 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail

[issue31217] test_code leaked [1, 1, 1] memory blocks on x86 Gentoo Refleaks 3.6/3.x

2017-08-31 Thread STINNER Victor
STINNER Victor added the comment: Ok, I succeeded to reproduce the issue on my amd64 laptop using gcc -m32. I'm now sure that the issue can be reproduced on 32-bit. Maybe the issue can be reproduced on 64-bit but is more unlikely? -- ___ Python trac

[issue31217] test_code leaked [1, 1, 1] memory blocks on x86 Gentoo Refleaks 3.6/3.x

2017-08-31 Thread STINNER Victor
STINNER Victor added the comment: Copy attached test_leak.py to Lib/test/ and run: set -x while true; do PYTHONHASHSEED=$RANDOM ./python -m test -R 3:30 -j1 test_leak || break; done -- Added file: http://bugs.python.org/file47110/test_leak.py ___ Py

[issue31217] test_code leaked [1, 1, 1] memory blocks on x86 Gentoo Refleaks 3.6/3.x

2017-08-31 Thread Zachary Ware
Changes by Zachary Ware : -- nosy: +zach.ware ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyth

[issue31315] assertion failure in imp.create_dynamic(), when spec.name is not a string

2017-08-31 Thread Brett Cannon
Brett Cannon added the comment: I'm about to go on vacation so I might not be right of mind to comment, but I think throwing a TypeError is valid if it's triggering an assertion error that is already there. P.S. Thanks for all the fuzz testing you're doing, Oren! -- _

[issue31315] assertion failure in imp.create_dynamic(), when spec.name is not a string

2017-08-31 Thread Oren Milman
Oren Milman added the comment: do you mean that we should fix it to raise a TypeError? the assertion is there, but not explicitly. get_encoded_name() calls PyUnicode_FindChar(), which calls PyUnicode_READY(), which does assert(_PyUnicode_CHECK). so i get: >>> import imp >>> >>> class BadSpec:

[issue31317] Memory leak in dict with shared keys

2017-08-31 Thread STINNER Victor
New submission from STINNER Victor: Copy attached test_leak.py to Lib/test/ and run: haypo@selma$ ./python -m test -R 3:30 test_leak Run tests in parallel using 1 child processes 0:00:00 load avg: 0.67 [1/1/1] test_leak failed beginning 33 repetitions 123456789012345678901234567890123 .

[issue31317] Memory leak in dict with shared keys

2017-08-31 Thread STINNER Victor
Changes by STINNER Victor : Added file: http://bugs.python.org/file47111/test_leak.py ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue31317] Memory leak in dict with shared keys

2017-08-31 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +serhiy.storchaka ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://

[issue31217] test_code leaked [1, 1, 1] memory blocks on x86 Gentoo Refleaks 3.6/3.x

2017-08-31 Thread STINNER Victor
STINNER Victor added the comment: I created bpo-31317: Memory leak in dict with shared keys. -- ___ Python tracker ___ ___ Python-bugs

[issue31317] Memory leak in dict with shared keys

2017-08-31 Thread STINNER Victor
STINNER Victor added the comment: If you cannot reproduce the bug on 32-bit build, try to set "FIXED_HASH = 0" in test_leak.py, run "./python -m test -R 3:10 test_leak" multiple times until it fails, then copy the last value of the printed list into hash_values in test_leak.py. -- __

[issue31315] assertion failure in imp.create_dynamic(), when spec.name is not a string

2017-08-31 Thread Brett Cannon
Brett Cannon added the comment: Yes, I'm saying that instead of hitting the C-level assertion error an explicit TypeError should be raised (or some other change like calling str() on the object). Either way, a C-level assertion from valid Python code is bad. :) --

[issue31317] Memory leak in dict with shared keys

2017-08-31 Thread STINNER Victor
STINNER Victor added the comment: I spent a lot of time in gdb, but I'm not sure anymore that the issue is related to dict shared keys. -- ___ Python tracker ___ ___

[issue31315] assertion failure in imp.create_dynamic(), when spec.name is not a string

2017-08-31 Thread Oren Milman
Changes by Oren Milman : -- pull_requests: +3301 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.p

[issue31317] Memory leak in dict with shared keys

2017-08-31 Thread Antoine Pitrou
Antoine Pitrou added the comment: It's a really weird bug you found. It depends on the exact values passed to -R: $ ./python -m test -R 3:6 test_haypoleak Run tests sequentially 0:00:00 load avg: 0.39 [1/1] test_haypoleak beginning 9 repetitions 123456789 . test_haypoleak leaked [1, 1,

[issue31317] Memory leak in dict with shared keys

2017-08-31 Thread Antoine Pitrou
Antoine Pitrou added the comment: Actually, it's not the bug that is weird, but the heuristics in -R seem completely weird now. If I print the alloc and rc deltas: $ ./python -m test -R 3:6 test_haypoleak Run tests sequentially 0:00:00 load avg: 0.09 [1/1] test_haypoleak beginning 9 repetition

[issue31317] Memory leak in dict with shared keys

2017-08-31 Thread Antoine Pitrou
Antoine Pitrou added the comment: s/completely weird/broken/ $ ./python -m test -R 2:20 test_haypoleak Run tests sequentially 0:00:00 load avg: 0.10 [1/1] test_haypoleak beginning 22 repetitions 1234567890123456789012 .. alloc: [0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,

[issue30776] regrtest: change -R/--huntrleaks rule to decide if a test leaks references

2017-08-31 Thread Antoine Pitrou
Antoine Pitrou added the comment: This change suddenly made detection of reference leaks a lot less effective. Now if you have a single 0 in the deltas list, it will consider there is no reference leak, even though all other values might be > 0. See https://bugs.python.org/issue31317#msg30106

[issue31317] Memory leak in dict with shared keys

2017-08-31 Thread Antoine Pitrou
Antoine Pitrou added the comment: To come back to this bug, it still fails if add a __slots__, so I don't think it's related to shared key dictionaries. -- ___ Python tracker __

[issue31317] Memory leak in dict with shared keys

2017-08-31 Thread STINNER Victor
STINNER Victor added the comment: Antoine: "Actually, it's not the bug that is weird, but the heuristics in -R seem completely weird now. If I print the alloc and rc deltas:" I changed it recently to reduce false alarms: see bpo-30776. Antoine: "To come back to this bug, it still fails if ad

[issue31217] test_code leaked [1, 1, 1] memory blocks on x86 Gentoo Refleaks 3.6/3.x

2017-08-31 Thread STINNER Victor
STINNER Victor added the comment: I'm still able to reproduce the bug using attached leak.py script which is now 100 lines long, but has to import logging, socket and pickle. Without these imports, the bug hides (maybe the hardcoded hash values must be recomputed, but I failed to find hash val

[issue31217] test_code leaked [1, 1, 1] memory blocks on x86 Gentoo Refleaks 3.6/3.x

2017-08-31 Thread Antoine Pitrou
Antoine Pitrou added the comment: Attached test script still fails even though the objects are pre-allocated, and without setting a hash seed. $ ./python -m test -R 3:6 test_haypoleak Run tests sequentially 0:00:00 load avg: 0.23 [1/1] test_haypoleak beginning 9 repetitions 123456789 .

[issue30776] regrtest: change -R/--huntrleaks rule to decide if a test leaks references

2017-08-31 Thread STINNER Victor
STINNER Victor added the comment: Antoine Pitrou: "Victor, it would be nice if you could find a less brutal heuristic." My current goal is to get green buildbots. If a buildbot is always red, it's hard to notify easily regressions. Since I rejected "false alarms" from refleak, the refleak bui

[issue31217] test_code leaked [1, 1, 1] memory blocks on x86 Gentoo Refleaks 3.6/3.x

2017-08-31 Thread STINNER Victor
STINNER Victor added the comment: leak2.py: script based on my leak.py and Antoine's test_haypoleak.py. If you replace "if 0:" with "if 1:", it seems like the test doesn't anymore. It seems like the "leak" is the call to sys.getallocatedblocks() which creates a new integer, and the integer is

[issue31217] test_code leaked [1, 1, 1] memory blocks on x86 Gentoo Refleaks 3.6/3.x

2017-08-31 Thread Antoine Pitrou
Antoine Pitrou added the comment: > It seems like the "leak" is the call to sys.getallocatedblocks() which > creates a new integer, and the integer is kept alive between two loop > iterations. I doubt it. If that was the case, the reference count would increase as well. -- _

[issue31217] test_code leaked [1, 1, 1] memory blocks on x86 Gentoo Refleaks 3.6/3.x

2017-08-31 Thread Antoine Pitrou
Antoine Pitrou added the comment: Actually, leak2.py doesn't attempt to cleanup anything between runs, so it can't be reliable for detecting leaks. You lack dash_R_cleanup() somewhere. -- ___ Python tracker _

[issue31217] test_code leaked [1, 1, 1] memory blocks on x86 Gentoo Refleaks 3.6/3.x

2017-08-31 Thread STINNER Victor
STINNER Victor added the comment: Antoine: "I doubt it. If that was the case, the reference count would increase as well." The bug is really weird :-) Antoine: "Actually, leak2.py doesn't attempt to cleanup anything between runs, so it can't be reliable for detecting leaks. You lack dash_R

[issue31217] test_code leaked [1, 1, 1] memory blocks on x86 Gentoo Refleaks 3.6/3.x

2017-08-31 Thread Antoine Pitrou
Antoine Pitrou added the comment: Ahah. Actually, it's quite simple :-) On 64-bit Python: >>> id(82914 - 82913) == id(1) True On 32-bit Python: >>> id(82914 - 82913) == id(1) False So the first non-zero alloc_delta really has a snowball effect, as it creates new memory block which will produ

[issue31217] test_code leaked [1, 1, 1] memory blocks on x86 Gentoo Refleaks 3.6/3.x

2017-08-31 Thread Antoine Pitrou
Antoine Pitrou added the comment: This patch does the trick: diff --git a/Lib/test/libregrtest/refleak.py b/Lib/test/libregrtest/refleak.py index efe5210..68e490a 100644 --- a/Lib/test/libregrtest/refleak.py +++ b/Lib/test/libregrtest/refleak.py @@ -48,6 +48,11 @@ def dash_R(the_module, test, in

[issue30776] regrtest: change -R/--huntrleaks rule to decide if a test leaks references

2017-08-31 Thread Antoine Pitrou
Antoine Pitrou added the comment: > Since I rejected "false alarms" from refleak, the refleak buildbot already > helped to identify a reference leak regression. Except that now it may hide actual regressions... False negatives are not better than false positives. -- _

[issue31217] test_code leaked [1, 1, 1] memory blocks on x86 Gentoo Refleaks 3.6/3.x

2017-08-31 Thread STINNER Victor
STINNER Victor added the comment: > So the first non-zero alloc_delta really has a snowball effect, as it creates > new memory block which will produce a non-zero alloc_delta on the next run, > etc. Oh, I suspected an issue around this code but I was unable to explain it. I focused strongly o

[issue30776] regrtest: change -R/--huntrleaks rule to decide if a test leaks references

2017-08-31 Thread STINNER Victor
STINNER Victor added the comment: > Except that now it may hide actual regressions... False negatives are not > better than false positives. Please put this issue in its context. 6 months ago, there was no more Refleak buildbot and everything was broken. If you want to make regrtest -R strice

[issue31217] test_code leaked [1, 1, 1] memory blocks on x86 Gentoo Refleaks 3.6/3.x

2017-08-31 Thread STINNER Victor
Changes by STINNER Victor : -- pull_requests: +3302 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mai

[issue31217] test_code leaked [1, 1, 1] memory blocks on x86 Gentoo Refleaks 3.6/3.x

2017-08-31 Thread STINNER Victor
STINNER Victor added the comment: Ok, I wrote a PR for my str(int(x)) workaround: https://github.com/python/cpython/pull/3258 I tested manually on the buildbot that it fixes all bugs listed on this issue. -- ___ Python tracker

[issue31217] test_code leaked [1, 1, 1] memory blocks on x86 Gentoo Refleaks 3.6/3.x

2017-08-31 Thread STINNER Victor
STINNER Victor added the comment: +int_pool = {i: i for i in range(-1000, 1000)} +def get_pooled_int(v): +return int_pool.setdefault(v, v) I'm not sure that I understand this code. It makes sure that you get a single object in memory for the same integer, and not only for Python

[issue31318] Windows importlib.util.find_spec("re") results in AttributeError: module 'importlib' has no attribute 'util'

2017-08-31 Thread elmar
New submission from elmar: Hi There, I found the following bug, but have now idea where to search to fix this: On Windows calling a python script from the command line with the line importlib.util.find_spec("re") in it or using the standard python shell and executing importlib.util.find_spec

[issue31318] On Windows importlib.util.find_spec("re") results in AttributeError: module 'importlib' has no attribute 'util'

2017-08-31 Thread elmar
Changes by elmar : -- components: +Windows nosy: +paul.moore, steve.dower, tim.golden, zach.ware title: Windows importlib.util.find_spec("re") results in AttributeError: module 'importlib' has no attribute 'util' -> On Windows importlib.util.find_spec("re") results in AttributeError: m

[issue31170] expat: utf8_toUtf8 cannot properly handle exhausting buffer

2017-08-31 Thread Benjamin Peterson
Benjamin Peterson added the comment: We can put expat 2.2.4 in 2.7.14 final. -- ___ Python tracker ___ ___ Python-bugs-list mailing li

[issue31318] On Windows importlib.util.find_spec("re") results in AttributeError: module 'importlib' has no attribute 'util'

2017-08-31 Thread Steve Dower
Steve Dower added the comment: util is a submodule of importlib, and so it should always be imported before using it. Other platforms may import it for various other reasons, but that is not part of the API. You should fix it by typing (note that the first line is different from yours): >>>

[issue31319] Add __main__.py to IDLE

2017-08-31 Thread Raymond Hettinger
New submission from Raymond Hettinger: Currently, I start IDLE with: $ python -m idlelib.idle It would be nice add __main__.py to simplify this to: $ python -m idlelib And perhaps, more boldly rename the directory so that we get: $ python -m idle -- assignee: terry.reedy compo