[issue32999] issubclass(obj, abc.ABC) causes a segfault

2018-03-23 Thread miss-islington
miss-islington added the comment: New changeset c71edab15d023360388da8360700d419b5f48c81 by Miss Islington (bot) in branch '3.7': bpo-32999: ast: Convert useless check to assert (GH-6197)

[issue32999] issubclass(obj, abc.ABC) causes a segfault

2018-03-23 Thread miss-islington
Change by miss-islington : -- pull_requests: +5945 ___ Python tracker ___

[issue32999] issubclass(obj, abc.ABC) causes a segfault

2018-03-23 Thread INADA Naoki
INADA Naoki added the comment: New changeset c65bf3fe4a2bde424b79e350f36b7aaa3f6476f6 by INADA Naoki in branch 'master': bpo-32999: ast: Convert useless check to assert (GH-6197) https://github.com/python/cpython/commit/c65bf3fe4a2bde424b79e350f36b7aaa3f6476f6

[issue32999] issubclass(obj, abc.ABC) causes a segfault

2018-03-23 Thread INADA Naoki
Change by INADA Naoki : -- pull_requests: +5944 ___ Python tracker ___ ___

[issue32999] issubclass(obj, abc.ABC) causes a segfault

2018-03-22 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: New changeset 5d8bb5d07be2a9205e7059090f0ac5360d36b217 by Ivan Levkivskyi (Miss Islington (bot)) in branch '3.7': bpo-32999: Revert GH-6002 (fc7df0e6) (GH-6189) (GH-6190)

[issue32999] issubclass(obj, abc.ABC) causes a segfault

2018-03-22 Thread miss-islington
Change by miss-islington : -- pull_requests: +5935 ___ Python tracker ___

[issue32999] issubclass(obj, abc.ABC) causes a segfault

2018-03-22 Thread INADA Naoki
INADA Naoki added the comment: New changeset f757b72b2524ce3451d2269f0b8a9f0593a7b27f by INADA Naoki in branch 'master': bpo-32999: Revert GH-6002 (fc7df0e6) (GH-6189) https://github.com/python/cpython/commit/f757b72b2524ce3451d2269f0b8a9f0593a7b27f --

[issue32999] issubclass(obj, abc.ABC) causes a segfault

2018-03-22 Thread INADA Naoki
Change by INADA Naoki : -- pull_requests: +5933 ___ Python tracker ___ ___

[issue32999] issubclass(obj, abc.ABC) causes a segfault

2018-03-07 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: Serhiy, for example `issubclass(typing.MutableMapping, typing.Mapping)` returns `True` while neither of those two are actual class objects. These relationships are kept mostly so that `typing.*` can be used as a drop-in replacement for

[issue32999] issubclass(obj, abc.ABC) causes a segfault

2018-03-07 Thread Alexey Izbyshev
Alexey Izbyshev added the comment: Sorry for status update, this was due to a concurrent modification. -- nosy: +jab resolution: -> fixed status: open -> closed ___ Python tracker

[issue32999] issubclass(obj, abc.ABC) causes a segfault

2018-03-07 Thread Alexey Izbyshev
Alexey Izbyshev added the comment: @inada.naoki: I don't question your change. My point is the same as in #33018 (I've discovered that PR only after I commented). The error message is misleading, and it's just a coincidence that a TypeError and not some other error is

[issue32999] issubclass(obj, abc.ABC) causes a segfault

2018-03-06 Thread Joshua Bronson
Change by Joshua Bronson : -- nosy: +jab ___ Python tracker ___ ___ Python-bugs-list

[issue32999] issubclass(obj, abc.ABC) causes a segfault

2018-03-06 Thread INADA Naoki
Change by INADA Naoki : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue32999] issubclass(obj, abc.ABC) causes a segfault

2018-03-06 Thread miss-islington
miss-islington added the comment: New changeset d824b4e4afbe9cf02310e39b14402fb2aa271f8f by Miss Islington (bot) in branch '3.7': bpo-32999: Fix ABC.__subclasscheck__ crash (GH-6002)

[issue32999] issubclass(obj, abc.ABC) causes a segfault

2018-03-06 Thread Joshua Bronson
Change by Joshua Bronson : -- pull_requests: +5780 ___ Python tracker ___ ___

[issue32999] issubclass(obj, abc.ABC) causes a segfault

2018-03-06 Thread miss-islington
Change by miss-islington : -- pull_requests: +5779 ___ Python tracker ___

[issue32999] issubclass(obj, abc.ABC) causes a segfault

2018-03-06 Thread INADA Naoki
INADA Naoki added the comment: New changeset fc7df0e664198cb05cafd972f190a18ca422989c by INADA Naoki in branch 'master': bpo-32999: Fix ABC.__subclasscheck__ crash (GH-6002) https://github.com/python/cpython/commit/fc7df0e664198cb05cafd972f190a18ca422989c --

[issue32999] issubclass(obj, abc.ABC) causes a segfault

2018-03-06 Thread INADA Naoki
INADA Naoki added the comment: > BTW, do TypeErrors related to weak references deserve any treatment? Isn't it > a kind of coincidence that the error raised due to usage of WeakSet in > issubclass(obj, ABC) is what we expect? (Sorry, I'm not familiar with > WeakSets).

[issue32999] issubclass(obj, abc.ABC) causes a segfault

2018-03-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Could you please show examples with __suclasscheck__ returning True for non-class objects? -- ___ Python tracker

[issue32999] issubclass(obj, abc.ABC) causes a segfault

2018-03-06 Thread Alexey Izbyshev
Alexey Izbyshev added the comment: OK, making a new implementation behave as the old one is fine with me too. BTW, do TypeErrors related to weak references deserve any treatment? Isn't it a kind of coincidence that the error raised due to usage of WeakSet in

[issue32999] issubclass(obj, abc.ABC) causes a segfault

2018-03-06 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: Actually, the behaviour when __suclasscheck__ returns True for non-class objects may be used by some code. Even typing module did this, I tried to remove as much as possible of this, but I think there may be few such situations left.

[issue32999] issubclass(obj, abc.ABC) causes a segfault

2018-03-06 Thread INADA Naoki
Change by INADA Naoki : -- keywords: +patch pull_requests: +5767 stage: -> patch review ___ Python tracker ___

[issue32999] issubclass(obj, abc.ABC) causes a segfault

2018-03-05 Thread Alexey Izbyshev
Change by Alexey Izbyshev : -- versions: +Python 3.7 ___ Python tracker ___ ___

[issue32999] issubclass(obj, abc.ABC) causes a segfault

2018-03-05 Thread Alexey Izbyshev
Alexey Izbyshev added the comment: I've also checked that ABC.register() doesn't allow non-classes (and PEP 3119 mentions that). Looking at PyObject_IsSubclass in Objects/abstract.c, the only case in which its check_class() could be avoided is if there is a custom

[issue32999] issubclass(obj, abc.ABC) causes a segfault

2018-03-05 Thread Alexey Izbyshev
Alexey Izbyshev added the comment: > Is there any sense in accepting non-types as the first argument of > issubclass()? No, though it is not (clearly) documented. The docs mention TypeError, but only for the second argument if my reading is correct. In practice,

[issue32999] issubclass(obj, abc.ABC) causes a segfault

2018-03-05 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Is there any sense in accepting non-types as the first argument of issubclass()? I would add a check just in issubclass(). -- nosy: +inada.naoki, serhiy.storchaka versions: +Python 3.7

[issue32999] issubclass(obj, abc.ABC) causes a segfault

2018-03-05 Thread Alexey Izbyshev
Alexey Izbyshev added the comment: In debug mode, the following assertion fails: python: ./Modules/_abc.c:642: _abc__abc_subclasscheck_impl: Assertion `((PyObject*)(mro))->ob_type))->tp_flags & ((1UL << 26))) != 0)' failed. --

[issue32999] issubclass(obj, abc.ABC) causes a segfault

2018-03-05 Thread Alexey Izbyshev
New submission from Alexey Izbyshev : Demo: >>> from abc import ABC >>> issubclass(1, ABC) Segmentation fault (core dumped) The stack trace is attached. Before reimplementation of abc in C, the result was confusing too: Python 3.6.4 (v3.6.4:d48eceb, Dec 19 2017, 06:54:40)