[New-bugs-announce] [issue12158] platform: add linux_version()

STINNER Victor report at bugs.python.org
Mon May 23 14:25:26 CEST 2011

New submission from STINNER Victor <victor.stinner at haypocalc.com>:

Sometimes, we need to know the version of the Linux kernel. Recent examples: test if SOCK_CLOEXEC or O_CLOEXEC are supported by the kernel or not. Linux < 2.6.23 *silently* ignores O_CLOEXEC flag of open().

linux_version() is already implemented in test_socket, but it looks like test_posix does also need it.

Attached patch adds platform.linux_version(). It returns (a, b, c) (integers) or None (if not Linux).

It raises an error if the version string cannot be parsed.

components: Library (Lib)
files: platform_linux_version.patch
keywords: patch
messages: 136621
nosy: charles-francois.natali, haypo, lemburg, pitrou
priority: normal
severity: normal
status: open
title: platform: add linux_version()
versions: Python 3.3
Added file: http://bugs.python.org/file22079/platform_linux_version.patch

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list