[issue17293] uuid.getnode() MAC address on AIX

STINNER Victor report at bugs.python.org
Sun Oct 12 17:13:37 CEST 2014


STINNER Victor added the comment:

+    cmd = 'LC_ALL=C %s %s 2>/dev/null' % (executable, '-ia')

It's safer to use the subprocess module instead of using a shell (see the recent Shellshock story) to change the environment variables and to redirect stderr. subprocess now has a convinient subprocess.DEVNULL. So it's something like:

env = os.environ.copy()
env['LC_ALL'] = 'C'
process = subprocess.Popen([executable, '-ia'], stderr=subprocess.DEVNULL)
...

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue17293>
_______________________________________


More information about the Python-bugs-list mailing list