[issue8292] Incorrect condition test in platform.py
Georg Brandl ge...@python.org added the comment: Thanks, committed patch as r83371. -- nosy: +georg.brandl resolution: - accepted status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8292 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8292] Incorrect condition test in platform.py
Ray.Allen ysj@gmail.com added the comment: It seems that the Lib/lib2to3/fixes/fix_filter.py should have fixed all the filter problem in py3k, by adding a list() call to filter(). It's werid this one still exists in standar library. Also I found other two problems with filter in standar library. They make condition tests on filter object, although the result is correct, but I think it's not proper. So I make a patch to fix these three problems. -- components: +Library (Lib) keywords: +patch nosy: +ysj.ray Added file: http://bugs.python.org/file16814/issue_8292.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8292 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8292] Incorrect condition test in platform.py
Marc-Andre Lemburg m...@egenix.com added the comment: A.M. Kuchling wrote: New submission from A.M. Kuchling li...@amk.ca: While looking at #4440, I grepped for similar problems and found one in platform.py in the following line: if no_os_uname or not filter(None, (system, node, release, version, machine)) In 3.x, filter() returns an object, not a list, so 'not filter()' will always be false. One fix is to either convert filter's output by adding list() or tuple(). Another fix could be 'not any ((system, node, release, version, machine))', but I don't know if platform.py is trying to stay compatible with versions of Python that lack any(). I'm trying to keep platform.py compatible with all Python versions since 2.3, so using the list() wrapper appears to be the better solution. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8292 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8292] Incorrect condition test in platform.py
New submission from A.M. Kuchling li...@amk.ca: While looking at #4440, I grepped for similar problems and found one in platform.py in the following line: if no_os_uname or not filter(None, (system, node, release, version, machine)) In 3.x, filter() returns an object, not a list, so 'not filter()' will always be false. One fix is to either convert filter's output by adding list() or tuple(). Another fix could be 'not any ((system, node, release, version, machine))', but I don't know if platform.py is trying to stay compatible with versions of Python that lack any(). -- assignee: lemburg keywords: easy messages: 102179 nosy: akuchling, lemburg severity: normal status: open title: Incorrect condition test in platform.py versions: Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8292 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com