New submission from Bar Harel <bzvi7...@gmail.com>:

Quick and small fix.

os.PathLike.__subclasshook__ does not check if cls is PathLike as abstract 
classes should.

This in turn causes this bug:

    class A(PathLike):
        pass

    class B:
        def __fspath__(self):
            pass

    assert issubclass(B, A)

I will fix the bug later today and push a patch over to python/cpython on 
GitHub.

----------
components: Library (Lib)
messages: 357174
nosy: bar.harel
priority: normal
severity: normal
status: open
title: os.PathLike subclasshook causes subclass checks true on abstract 
implementation
type: behavior
versions: Python 3.6, Python 3.7, Python 3.8, Python 3.9

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue38878>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to