[issue26934] android: test_faulthandler fails

2016-11-09 Thread Xavier de Gaye
Xavier de Gaye added the comment: New patch. -- Added file: http://bugs.python.org/file45404/buggy_raise_4.patch ___ Python tracker ___ __

[issue28637] Python startup performance regression

2016-11-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: On my computer: Importing empty module: 160 us Creating empty class: 30 us Creating empty function: 0.16 us Creating empty Enum/IntEnum: 125/150 us Creating Enum/IntEnum member: 25/27 us Creating empty namedtuple: 600 us Creating namedtuple member: 50 us Impor

[issue26934] android: test_faulthandler fails

2016-11-09 Thread STINNER Victor
STINNER Victor added the comment: buggy_raise_4.patch LGTM. Thanks for your patience :-) Maybe later you can also modify existing tests to use the new @requires_android_level? -- ___ Python tracker ___

[issue28644] Document recen changes in typing.py

2016-11-09 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: Thanks Mariatta, here is a new version of patch with indentation fixed. -- Added file: http://bugs.python.org/file45405/recent-typing-docs-v3.diff ___ Python tracker _

[issue28637] Python startup performance regression

2016-11-09 Thread STINNER Victor
STINNER Victor added the comment: About the re module, there is still a regression on the performance of the import time: see my msg280271. We may also revert the changeset 88110cfbf4dc (issue #28193) if we want to keep "import re" as fast as Python 3.5. The question is if we consider that the

[issue28642] csv reader losing rows with big files and tab delimiter

2016-11-09 Thread Marc Garcia
Marc Garcia added the comment: I could research a bit more on the problem. This is a minimal code that reproduces what happened: from io import StringIO import csv csv_file = StringIO('''1\t"A 2\tB''') reader = csv.reader(csv_file, delimiter='\t') for i, row in enumera

[issue28642] csv reader losing rows with big files and tab delimiter

2016-11-09 Thread SilentGhost
SilentGhost added the comment: No, the module works exactly as advertised. The default value of quoting parameter might not be suitable for this file, but it suits majority of files out there. The fields in csv can contain line feed, so the line in your example does not have a "missing" quote,

[issue28642] csv reader losing rows with big files and tab delimiter

2016-11-09 Thread Marc Garcia
Marc Garcia added the comment: I agree that for my case, I was using the wrong quoting parameter, and if I specify that my file has no quotes, it works as expected. But I still think that in a different case, when a file do have quotes, but they are not paired, it'd be better to raise an excep

[issue26934] android: test_faulthandler fails

2016-11-09 Thread Xavier de Gaye
Xavier de Gaye added the comment: > Thanks for your patience :-) No problem, your suggestions and code reviews are always very much welcome :) I will push this patch with the other Android patches after 3.6 is released. The patch at issue 26936 will also use @requires_android_level. --

[issue26929] android: test_strptime fails

2016-11-09 Thread Xavier de Gaye
Xavier de Gaye added the comment: Patch attached. -- assignee: -> xdegaye components: -Cross-Build keywords: +patch stage: -> patch review versions: +Python 3.7 Added file: http://bugs.python.org/file45406/exclude_ymd.patch ___ Python tracker

[issue26929] android: test_strptime fails

2016-11-09 Thread Xavier de Gaye
Xavier de Gaye added the comment: Entered new issue https://code.google.com/p/android/issues/detail?id=227388 on the AOSP issue tracker. -- ___ Python tracker ___ __

[issue28647] python --help: -u is misdocumented as binary mode

2016-11-09 Thread Armin Rigo
New submission from Armin Rigo: ``python3.5 --help`` gives this information: -u : unbuffered binary stdout and stderr, stdin always buffered However, stdout and stderr are actually always opened in text mode, and print() always expects a string and never a bytes object. This usage of "bin

[issue28647] python --help: -u is misdocumented as binary mode

2016-11-09 Thread STINNER Victor
STINNER Victor added the comment: Right. Moreover, "unbuffered" is wrong. It's line buffered: sys.stdout.buffer is directly a io.FileIO object, but TextIOWrapper only calls buffer.write() when the message contains a newline character. It's not (currently) possible to have a fully unbuffered st

[issue28647] python --help: -u is misdocumented as binary mode

2016-11-09 Thread Eryk Sun
Eryk Sun added the comment: > It's not (currently) possible to have a fully unbuffered stdout. Why doesn't create_stdio also pass `write_through = Py_True` when Py_UnbufferedStdioFlag is set? This would immediately pass writes through to the FileIO object, even without containing a newline (i.

[issue28647] python --help: -u is misdocumented as binary mode

2016-11-09 Thread STINNER Victor
STINNER Victor added the comment: I don't recall, I would have to search in old issues for the rationale. But the explanation is probably performance, reduce the number of syscalls. -- ___ Python tracker __

[issue28647] python --help: -u is misdocumented as binary mode

2016-11-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The write_through argument was added only in 3.3. I think this is a good idea to pass `write_through = Py_True` when Py_UnbufferedStdioFlag is set. Using -u means that performance is not important (that is why this is not default behavior). -- nosy:

[issue27942] Default value identity regression

2016-11-09 Thread Yury Selivanov
Yury Selivanov added the comment: The patch is causing refleaks: test_ast leaked [98, 98, 98] references, sum=294 test_code leaked [2, 2, 2] references, sum=6 Please review the attached patch fixing that. Please review. -- nosy: +benjamin.peterson, larry, ned.deily, yselivanov

[issue28641] Describe PEP 495 features in "What's New in Python 3.6" document

2016-11-09 Thread Paul G
Paul G added the comment: I've never written a "What's New" before, but here are the main things I took away from implementing a PEP 495-compliant tzinfo class: - The `fold` attribute is the SECOND occurrence of the time, not the first occurrence of the time. In my first pass solution of this,

[issue28641] Describe PEP 495 features in "What's New in Python 3.6" document

2016-11-09 Thread Yury Selivanov
Yury Selivanov added the comment: Thanks, Paul. I'm adding Elvis to the nosy list, he's the main editor of What's New in 3.6. -- nosy: +Elvis.Pranskevichus, yselivanov ___ Python tracker __

[issue27942] Default value identity regression

2016-11-09 Thread Yury Selivanov
Yury Selivanov added the comment: Looks like the attached patch also fixes test_trace leaked [12, 12, 12] references, sum=36 -- ___ Python tracker ___ ___

[issue28635] Update What's New for 3.6

2016-11-09 Thread Yury Selivanov
Yury Selivanov added the comment: Elvis, please take a look at http://bugs.python.org/issue28641 -- ___ Python tracker ___ ___ Python-

[issue27942] Default value identity regression

2016-11-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Good catch! The patch LGTM, thanks Yury. Interesting, what tests in test_ast leak? I expected that this branch is executed in rare circumstances. -- ___ Python tracker

[issue27942] Default value identity regression

2016-11-09 Thread Yury Selivanov
Yury Selivanov added the comment: > Interesting, what tests in test_ast leak? I expected that this branch is > executed in rare circumstances. The test that tests it all :) test_stdlib_validates -- ___ Python tracker

[issue27942] Default value identity regression

2016-11-09 Thread Yury Selivanov
Yury Selivanov added the comment: Thanks for the review, Serhiy! -- priority: release blocker -> normal resolution: -> fixed status: open -> closed ___ Python tracker ___ __

[issue27942] Default value identity regression

2016-11-09 Thread Roundup Robot
Roundup Robot added the comment: New changeset 41613bb27f80 by Yury Selivanov in branch '2.7': Issue #27942: Fix memory leak in codeobject.c https://hg.python.org/cpython/rev/41613bb27f80 New changeset 2c6825c9ecfd by Yury Selivanov in branch '3.5': ssue #27942: Fix memory leak in codeobject.c h

[issue27942] Default value identity regression

2016-11-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > The test that tests it all :) test_stdlib_validates :) -- ___ Python tracker ___ ___ Python-bug

[issue28647] python --help: -u is misdocumented as binary mode

2016-11-09 Thread STINNER Victor
STINNER Victor added the comment: Would it make sense to have two modes: line buferred and unbuffered, as the C function setvbuf() for stdout? -- ___ Python tracker ___ _

[issue28648] False assert in _Py_DecodeUTF8_surrogateescape

2016-11-09 Thread Xiang Zhang
New submission from Xiang Zhang: The assert statement `assert(Py_UNICODE_IS_SURROGATE(ch));` in _Py_DecodeUTF8_surrogateescape is wrong. Code points > 0x could reach it and fail. -- files: false_assert.patch keywords: patch messages: 280406 nosy: serhiy.storchaka, xiang.zhang prior

[issue28649] refleak in typing.py

2016-11-09 Thread Yury Selivanov
New submission from Yury Selivanov: Looks like we have a refleak somewhere in the system that typing.py is exposing. The following code exposes the refleak: def test_refleak(self): T = typing.TypeVar('T') class C(typing.Generic[T], typing.Mapping[int, str]): ... The change

[issue27854] Installed 2.7: IDLE Help disabled because help.html is missing

2016-11-09 Thread Steve Dower
Steve Dower added the comment: Tools/msi/msi.py has a whole lot of code to explicitly include certain files. Probably just needs a line (or a glob) added into the idlelib section -- ___ Python tracker

[issue28637] Python startup performance regression

2016-11-09 Thread Guido van Rossum
Guido van Rossum added the comment: Honestly now the basic startup time is under control I am fine with restoring the re enum. We can optimize that later. --Guido (mobile) -- ___ Python tracker ___

[issue28650] concurrent.futures.ThreadPoolExecutor: tasks in queue not marked as done

2016-11-09 Thread pyfm
New submission from pyfm: Hi, I just realized that the ThreadPoolExecutor's workers do not call task_done() on the work_queue from which they took their task. Or is there a reason for not calling task_done that I am missing? Calling task_done decrements the queue's unfinished_tasks counter whi

[issue28649] refleak in typing.py

2016-11-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Could it be related to leaks in objects with empty __slots__? See issue24379 for details. -- ___ Python tracker ___ _

[issue28649] refleak in typing.py

2016-11-09 Thread Yury Selivanov
Yury Selivanov added the comment: > Could it be related to leaks in objects with empty __slots__? See issue24379 > for details. Not sure... Do we have a test/patch for objects-with-empty-slots bug? -- ___ Python tracker

[issue28649] refleak in typing.py

2016-11-09 Thread Guido van Rossum
Guido van Rossum added the comment: Ivan, this was an early typing.py update (merged into CPython on Sept. 27). But the refleak is still with us. Do you have any intuition on what could be going on here? My own intuition here is lacking, other than thinking there's a lot of metaclass magic go

[issue28649] refleak in typing.py

2016-11-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: >>> import gc >>> gc.collect() 23 >>> gc.collect() 0 >>> class A: ... __slots__ = () ... >>> del A >>> gc.collect() 2 ^ leak -- ___ Python tracker __

[issue28649] refleak in typing.py

2016-11-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: See also https://mail.python.org/pipermail/python-dev/2015-October/141993.html. -- ___ Python tracker ___

[issue24329] __qualname__ and __slots__

2016-11-09 Thread Yury Selivanov
Yury Selivanov added the comment: Serhiy, maybe you know how to fix this? -- nosy: +serhiy.storchaka versions: +Python 3.7 -Python 3.5 ___ Python tracker ___

[issue28643] Broken makefile depends for profile-opt target

2016-11-09 Thread Brett Cannon
Changes by Brett Cannon : -- stage: needs patch -> patch review ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue28643] Broken makefile depends for profile-opt target

2016-11-09 Thread Brett Cannon
Changes by Brett Cannon : -- nosy: +brett.cannon, gregory.p.smith ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe

[issue28649] refleak in typing.py

2016-11-09 Thread Guido van Rossum
Guido van Rossum added the comment: Serhiy, why is `gc.collect()` returning 2 after `del A` proof of a leak? Yes, there's a cycle, but it's being GC'ed -- isn't that fine? Without the slots the collect() call returns a larger number. -- ___ Python tra

[issue24329] __qualname__ and __slots__

2016-11-09 Thread Xiang Zhang
Xiang Zhang added the comment: Why should it work Yury? __qualname__ and __doc__(if exists) are inserted into the dict when creating a class. >>> class Foo: ... """bar""" ... __slots__ = ('__doc__',) ... Traceback (most recent call last): File "", line 1, in ValueError: '__doc__' i

[issue24329] __qualname__ and __slots__

2016-11-09 Thread Yury Selivanov
Yury Selivanov added the comment: Because the following works without a problem: class F: __slots__ = ('__name__', ) f = F() f.__name__ = '' This bug with __qualname__ is why _GeneratorWrapper in types.py doesn't have __slots__. -- _

[issue28649] refleak in typing.py

2016-11-09 Thread Yury Selivanov
Yury Selivanov added the comment: Attached patch (slots_gc.patch) makes objects with empty slots tracked by GC: class A: __slots__ = () gc.is_tracked(A()) == False # before gc.is_tracked(A()) == True # with the patch This doesn't fix the refleak though. -- keywords: +patch

[issue28649] refleak in typing.py

2016-11-09 Thread Yury Selivanov
Yury Selivanov added the comment: I removed all slots from typing.py, the refleak is still there. -- ___ Python tracker ___ ___ Python

[issue27584] New addition of vSockets to the python socket module

2016-11-09 Thread Cathy Avery
Cathy Avery added the comment: Please forgive the long delay in providing this update. I got a little sidetracked. Attached is the patch for Python 3.7. It includes fixes suggested in rev 1 plus VSOCK tests in test_socket.py. Thanks, Cathy -- versions: +Python 3.7 -Python 3.6 Added f

[issue28649] refleak in typing.py

2016-11-09 Thread Yury Selivanov
Yury Selivanov added the comment: Wow. In default CPython branch, with no modifications, test_typing.py simply crashes in debug mode: yury@ysmbp ~/dev/py/cpython $ ./python.exe -m test -R3:3 test_typing Run tests sequentially 0:00:00 [1/1] test_typing beginning 6 repetitions 123456 .test test_t

[issue28649] refleak in typing.py

2016-11-09 Thread Yury Selivanov
Yury Selivanov added the comment: The problem is that functools.lru_cache is used in _tp_cache. If I remove type caching, the original "refleak" is fixed. -- ___ Python tracker ___

[issue24379] Add operator.subscript as a convenience for creating slices

2016-11-09 Thread Yury Selivanov
Yury Selivanov added the comment: Even more reduced test case: def test_refleak(self): T = typing.TypeVar('T') typing.Generic[T] -- nosy: +yselivanov ___ Python tracker

[issue28649] refleak in typing.py

2016-11-09 Thread Josh Rosenberg
Josh Rosenberg added the comment: Serhiy: I think you forgot to make a global instance of the type for your demonstration. You mentioned in msg253899 that the loop is: global instance -> type -> method -> module globals -> global instance The example you gave doesn't instantiate class A, and i

[issue28651] Make objects with empty __slots__ GC types

2016-11-09 Thread Yury Selivanov
New submission from Yury Selivanov: The attached patch does the trick. I'm not sure if this should be fixed in 3.6. -- components: Interpreter Core files: slots_gc.patch keywords: patch messages: 280427 nosy: gvanrossum, serhiy.storchaka, yselivanov priority: normal severity: normal sta

[issue28649] refleak in typing.py

2016-11-09 Thread Yury Selivanov
Yury Selivanov added the comment: Josh, Serhiy, I've created an issue for tracking empty slots types: #28651. This issue is about typing.py using functools.lru_cache for internal cache That is what causing the refleaks, and inability of test_typing.py to be run in refleak hunting mode. -

[issue19717] resolve() fails when the path doesn't exist

2016-11-09 Thread Steve Dower
Steve Dower added the comment: Anyone have any major concerns with add_non_strict_resolve_pathlib_v4.patch? I'd be quite happy without adding the extra parameter to Path.resolve(), but I'm not strongly offended. >From Guido's email we should default to strict=False (i.e. don't throw if the >f

[issue28649] refleak in typing.py

2016-11-09 Thread Guido van Rossum
Guido van Rossum added the comment: I could use a hint on a complete program that establishes whether there is or is not a refleak. -- ___ Python tracker ___

[issue28649] refleak in typing.py

2016-11-09 Thread Guido van Rossum
Guido van Rossum added the comment: Good sleuthing! So the bug is in _lru_cache? On Wed, Nov 9, 2016 at 10:37 AM, Guido van Rossum wrote: > > Guido van Rossum added the comment: > > I could use a hint on a complete program that establishes whether there is > or is not a refleak. > > --

[issue19717] resolve() fails when the path doesn't exist

2016-11-09 Thread Guido van Rossum
Guido van Rossum added the comment: I'd be very happy if that landed in 3.6 with the default strict=False. -- ___ Python tracker ___ _

[issue23839] Clear caches after every test

2016-11-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Synchronized with current code and added clearing typing caches. -- Added file: http://bugs.python.org/file45413/regrtest_clear_caches_2.patch ___ Python tracker

[issue28649] refleak in typing.py

2016-11-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > Serhiy, why is `gc.collect()` returning 2 after `del A` proof of a leak? Sorry, it was bad example. I don't remember all details. > The problem is that functools.lru_cache is used in _tp_cache. If I remove > type caching, the original "refleak" is fixed.

[issue28651] Make objects with empty __slots__ GC types

2016-11-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Needed tests. If an example with typing causes a leak (msg280422) this should be fixed in all versions that have typing. -- ___ Python tracker __

[issue28649] refleak in typing.py

2016-11-09 Thread Guido van Rossum
Guido van Rossum added the comment: I have no objections against typing-clear-caches.patch (though we'll have to make sure to apply it to the GitHub upstream as well -- I can take care of that once you merge it to CPython). Does that patch fix the refleak completely or only partially? I have

[issue28649] refleak in typing.py

2016-11-09 Thread Yury Selivanov
Yury Selivanov added the comment: > Good sleuthing! So the bug is in _lru_cache? I don't think it's a bug of lru_cache. It stores strong references for arguments and return value of the decorated function (which btw isn't documented). I don't think it's possible to write efficient generic lru

[issue28649] refleak in typing.py

2016-11-09 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: Yury, Guido, I think I understand why test_typing crashes in refleak hunting mode. The test relies on caching, namely type variables are compared by id, so that if cache is cleared between those two lines, then test fails. I think we should just update those

[issue28649] refleak in typing.py

2016-11-09 Thread Yury Selivanov
Yury Selivanov added the comment: > Does that patch fix the refleak completely or only partially? I tried to empty the cache in test_typing.BaseTestCase.setUp and tearDown; this doesn't fix all refleaks. Do we have some other caches in typing.py? -- __

[issue28649] refleak in typing.py

2016-11-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > Does that patch fix the refleak completely or only partially? It fixes 96% of refleaks. -- ___ Python tracker ___ _

[issue28649] refleak in typing.py

2016-11-09 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: Yury, _tp_cache should be the only one (of course most generic classes have _abc_cache since GenericMeta inherits from ABCMeta) -- ___ Python tracker

[issue28649] refleak in typing.py

2016-11-09 Thread Guido van Rossum
Guido van Rossum added the comment: FYI I've opened https://github.com/python/typing/issues/323 to track this upstream. -- ___ Python tracker ___ ___

[issue28649] refleak in typing.py

2016-11-09 Thread Guido van Rossum
Guido van Rossum added the comment: > It fixes 96% of refleaks. In typing.py? Or generally? -- ___ Python tracker ___ ___ Python-bugs

[issue28649] refleak in typing.py

2016-11-09 Thread Yury Selivanov
Yury Selivanov added the comment: > Yury, _tp_cache should be the only one (of course most generic classes have > _abc_cache since GenericMeta inherits from ABCMeta) Then there is at least one more bug not related to lru_cache (or any kind of cache in typing). And it's not classes-with-empty-

[issue28651] Make objects with empty __slots__ GC types

2016-11-09 Thread Yury Selivanov
Yury Selivanov added the comment: So this patch has no impact on typing.py. Moreover, it's incomplete and fails test_gc tests, which can be fixed but not in 3.6. -- versions: -Python 3.6 ___ Python tracker _

[issue28649] refleak in typing.py

2016-11-09 Thread Yury Selivanov
Yury Selivanov added the comment: Serhiy's patch typing-clear-caches.patch looks good, we should apply it (fixing the code style a little bit). -- ___ Python tracker ___ ___

[issue28649] refleak in typing.py

2016-11-09 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: Here is the corrected patch to avoid crash. -- Added file: http://bugs.python.org/file45416/fix-typing-test-v2.diff ___ Python tracker ___

[issue28652] Make loop methods reject socket kinds they do not support.

2016-11-09 Thread Yury Selivanov
New submission from Yury Selivanov: Proxy for https://github.com/python/asyncio/pull/453 -- assignee: yselivanov components: asyncio messages: 280448 nosy: gvanrossum, yselivanov priority: normal severity: normal stage: resolved status: open title: Make loop methods reject socket kinds t

[issue28652] Make loop methods reject socket kinds they do not support.

2016-11-09 Thread Yury Selivanov
Changes by Yury Selivanov : -- resolution: -> fixed status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list U

[issue28652] Make loop methods reject socket kinds they do not support.

2016-11-09 Thread Roundup Robot
Roundup Robot added the comment: New changeset 85022978d900 by Yury Selivanov in branch '3.5': Issue #28652: Make loop methods reject socket kinds they do not support. https://hg.python.org/cpython/rev/85022978d900 New changeset 1273f1a3ddf7 by Yury Selivanov in branch '3.6': Merge 3.5 (issue #2

[issue24379] Add operator.subscript as a convenience for creating slices

2016-11-09 Thread Yury Selivanov
Changes by Yury Selivanov : -- Removed message: http://bugs.python.org/msg280422 ___ Python tracker ___ ___ Python-bugs-list mailing l

[issue19717] resolve() fails when the path doesn't exist

2016-11-09 Thread Steve Dower
Steve Dower added the comment: Applied. I changed the default for the parameter and updated the docs, but the rest is as in the patch. -- assignee: -> steve.dower resolution: -> fixed stage: -> commit review ___ Python tracker

[issue19717] resolve() fails when the path doesn't exist

2016-11-09 Thread Roundup Robot
Roundup Robot added the comment: New changeset 03bbee2b0d28 by Steve Dower in branch '3.6': Issue #19717: Makes Path.resolve() succeed on paths that do not exist (patch by Vajrasky Kok) https://hg.python.org/cpython/rev/03bbee2b0d28 New changeset 445415e402be by Steve Dower in branch 'default':

[issue19717] resolve() fails when the path doesn't exist

2016-11-09 Thread Guido van Rossum
Guido van Rossum added the comment: Thanks! -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyt

[issue28556] typing.py upgrades

2016-11-09 Thread Roundup Robot
Roundup Robot added the comment: New changeset 9c0df5f51baa by Guido van Rossum in branch '3.5': Issue #28556: More typing.py updates from upstream. https://hg.python.org/cpython/rev/9c0df5f51baa New changeset 9e65bc305a24 by Guido van Rossum in branch '3.6': Issue #28556: More typing.py updates

[issue28649] refleak in typing.py

2016-11-09 Thread Roundup Robot
Roundup Robot added the comment: New changeset d790078797bd by Guido van Rossum in branch '3.5': Issue #28649: fix-typing-test-v2.diff https://hg.python.org/cpython/rev/d790078797bd New changeset 43be7891b1f5 by Guido van Rossum in branch '3.6': Issue #28649: fix-typing-test-v2.diff (3.5->3.6) h

[issue28649] refleak in typing.py

2016-11-09 Thread Roundup Robot
Roundup Robot added the comment: New changeset d920bfa5a71a by Guido van Rossum in branch '3.5': Issue #28649: typing-clear-caches.patch https://hg.python.org/cpython/rev/d920bfa5a71a New changeset bd2ec9965f47 by Guido van Rossum in branch '3.6': Issue #28649: typing-clear-caches.patch (3.5->3.

[issue24379] Add operator.subscript as a convenience for creating slices

2016-11-09 Thread Josh Rosenberg
Josh Rosenberg added the comment: #28651 opened for the general problem with empty __slots__ and gc failures. -- ___ Python tracker ___ __

[issue28649] refleak in typing.py

2016-11-09 Thread Guido van Rossum
Guido van Rossum added the comment: Serhiy can you apply the non-typing.py part of typing-clear-caches.patch? The diff I applied only has the typing.py part (because I've done this upstream first). -- ___ Python tracker

[issue28649] refleak in typing.py

2016-11-09 Thread Roundup Robot
Roundup Robot added the comment: New changeset d926b484d33a by Serhiy Storchaka in branch '3.5': Issue #28649: Clear the typing module caches when search for reference leaks. https://hg.python.org/cpython/rev/d926b484d33a New changeset caf3ceb93307 by Serhiy Storchaka in branch '3.6': Issue #286

[issue28649] refleak in typing.py

2016-11-09 Thread Yury Selivanov
Yury Selivanov added the comment: With all commits pushed, test_typing still seems to leak. Ivan, do you have time to see what's going on? test_typing leaked [125, 125, 125] references, sum=375 test_typing leaked [49, 49, 49] memory blocks, sum=147 --

[issue28649] refleak in typing.py

2016-11-09 Thread Yury Selivanov
Yury Selivanov added the comment: The specific test that leaks is test_extended_generic_rules_eq -- ___ Python tracker ___ ___ Python-

[issue28649] refleak in typing.py

2016-11-09 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: Yury, yes I will take a look at this now. -- ___ Python tracker ___ ___ Python-bugs-list mailing li

[issue28649] refleak in typing.py

2016-11-09 Thread Yury Selivanov
Yury Selivanov added the comment: Ivan, this is the part of the test that leaks: def test_extended_generic_rules_eq(self): T = TypeVar('T') U = TypeVar('U') with self.assertRaises(TypeError): Callable[[T], U][[], int] -- _

[issue28649] refleak in typing.py

2016-11-09 Thread Yury Selivanov
Yury Selivanov added the comment: Oh. This is a bug in C implementation of functools.lru_cache. I'll take a look. -- ___ Python tracker ___ __

[issue28649] refleak in typing.py

2016-11-09 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: My impression is like something wrong happens when TypeError is raised by a cached function. -- ___ Python tracker ___ ___

[issue28649] refleak in typing.py

2016-11-09 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: A very simple repro: with self.assertRaises(TypeError): Union[[]] It looks like the problem happens when a non-hashable argument is passed to cached function -- ___ Python tracker

[issue28649] refleak in typing.py

2016-11-09 Thread Yury Selivanov
Yury Selivanov added the comment: reflesk with only functools: def test_lru_type_error(self): @functools.lru_cache(maxsize=None) def foo(o): raise TypeError with self.assertRaises(TypeError): foo([]) -- __

[issue28649] refleak in typing.py

2016-11-09 Thread Yury Selivanov
Yury Selivanov added the comment: Found it, will open a separate issue. -- resolution: -> fixed stage: needs patch -> resolved status: open -> closed ___ Python tracker ___

[issue28653] refleak in functools.lru_cache

2016-11-09 Thread Yury Selivanov
New submission from Yury Selivanov: The attached patch fixes a refleak in functools.lru_cache. -- components: Library (Lib) files: refleak.patch keywords: patch messages: 280468 nosy: gvanrossum, larry, ned.deily, serhiy.storchaka, yselivanov priority: release blocker severity: normal st

[issue28649] refleak in typing.py

2016-11-09 Thread Yury Selivanov
Yury Selivanov added the comment: See http://bugs.python.org/issue28653 for details. -- ___ Python tracker ___ ___ Python-bugs-list ma

[issue28653] refleak in functools.lru_cache

2016-11-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: LGTM. -- assignee: -> yselivanov stage: patch review -> commit review ___ Python tracker ___ ___

[issue28653] refleak in functools.lru_cache

2016-11-09 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: FWIW, if I comment out this code try: from _functools import _lru_cache_wrapper except ImportError: pass in functools.py to use the pure Python version, then I get much larger numbers: $ ./python -m test -R : test_typing Run tests sequentially 0:00:00

[issue28653] refleak in functools.lru_cache

2016-11-09 Thread Roundup Robot
Roundup Robot added the comment: New changeset ba59f3328032 by Yury Selivanov in branch '3.5': Issue #28653: Fix a refleak in functools.lru_cache. https://hg.python.org/cpython/rev/ba59f3328032 New changeset 5b253d641826 by Yury Selivanov in branch '3.6': Merge 3.6 (issue #28653) https://hg.pyth

[issue28653] refleak in functools.lru_cache

2016-11-09 Thread Yury Selivanov
Yury Selivanov added the comment: > FWIW, if I comment out this code Oh boy... This is something else. Please re-open #28649 explaining that it now leaks with pure-Python lru_cache. Could you please take a look at it? -- ___ Python tracker

[issue28653] refleak in functools.lru_cache

2016-11-09 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: It seems to be unrelated to typing.py With your test from test_functools: def test_lru_type_error(self): @functools.lru_cache(maxsize=None) def infinite_cache(o): pass with self.assertRaises(TypeError): infini

  1   2   >