Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overridden method called instead of base class method #1808

Open
slozier opened this issue Nov 8, 2024 · 0 comments
Open

Overridden method called instead of base class method #1808

slozier opened this issue Nov 8, 2024 · 0 comments

Comments

@slozier
Copy link
Contributor

slozier commented Nov 8, 2024

The following throws an exception instead of succeeding:

from io import BytesIO
f = BytesIO()
f.read()

class MyBytesIO(BytesIO):
    def read(self, n=None):
        raise Exception

f = MyBytesIO()
BytesIO.read(f)

See also #1129 and #1070.


Ran into this issue when trying to run:

make.ps1 test-"CPython.test_iter|IronPython.test_io_stdlib"

In this case it was causing a StackOverflowException:

from io import BytesIO
f = BytesIO()
f.read()

class MyBytesIO(BytesIO):
    def read(self, n=None):
        return super().read(n)

f = MyBytesIO()
f.read()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant