Hagen Fürstenau hfuerste...@gmx.net added the comment:
This also solves issue 3729.
--
nosy: +hagen
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5137
___
Antoine Pitrou pit...@free.fr added the comment:
Wouldn't it be better to use PyNumber_AsSsize_t() instead, so as to
support all __index__-enabled objects?
--
nosy: +pitrou
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5137
Benjamin Peterson benja...@python.org added the comment:
Yes, good idea.
Added file: http://bugs.python.org/file12979/SystemError_bad_len2.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5137
Antoine Pitrou pit...@free.fr added the comment:
I don't think you need to call PyNumber_Check() (unless you want to
customize the error message).
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5137
Changes by Benjamin Peterson benja...@python.org:
Added file: http://bugs.python.org/file12980/bad_len3.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5137
___
Antoine Pitrou pit...@free.fr added the comment:
The patch is ok to me. (I assume all tests pass fine :-))
--
assignee: - benjamin.peterson
keywords: -needs review
resolution: - accepted
___
Python tracker rep...@bugs.python.org
Benjamin Peterson benja...@python.org added the comment:
Thanks for the reviews! Fixed in r69451.
--
resolution: accepted - fixed
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5137
Benjamin Peterson benja...@python.org added the comment:
Here's patch that raises a TypeError like 2.x.
--
keywords: +needs review, patch
nosy: +benjamin.peterson
Added file: http://bugs.python.org/file12969/SystemError_bad_len.patch
___
Python
New submission from Raymond Hettinger rhettin...@users.sourceforge.net:
len(obj) is not happy when obj.__len__() returns a non-number.
--
files: crasher_len.py
messages: 81024
nosy: rhettinger
priority: release blocker
severity: normal
status: open
title: SystemError when __len__