8000 [2.7] bpo-30061: Check if PyObject_Size()/PySequence_Size()/PyMapping_Size() (GH-1096) (GH-1180) by serhiy-storchaka · Pull Request #1183 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

[2.7] bpo-30061: Check if PyObject_Size()/PySequence_Size()/PyMapping_Size() (GH-1096) (GH-1180) #1183

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

Merged
merged 3 commits into from
Apr 19, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Use next() rather than __next__().
  • Loading branch information
serhiy-storchaka committed Apr 19, 2017
commit 18bd8d5ca2596ded55dab053d4ee8de93a2b67c0
4 changes: 2 additions & 2 deletions Lib/test/test_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -406,9 +406,9 @@ def readline(self):

def test_next_nonsizeable(self):
# Issue #30061
# Crash when __next__() returns an object without __len__
# Crash when next() returns an object without __len__
class R(self.IOBase):
def __next__(self):
def next(self):
return None
self.assertRaises(TypeError, R().readlines, 1)

Expand Down
4 changes: 2 additions & 2 deletions Misc/NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ Extension Modules
Library
-------

- bpo-30061: Fixed crashes in IOBase methods __next__() and readlines() when
readline() or __next__() respectively return non-sizeable object.
- bpo-30061: Fixed crashes in IOBase methods next() and readlines() when
readline() or next() respectively return non-sizeable object.
Fixed possible other errors caused by not checking results of PyObject_Size(),
PySequence_Size(), or PyMapping_Size().

Expand Down
0