'Retrieve the address of an environment variable on the remote
system.
Note:
The exact address will differ based on what other environment
variables are set, as well as argv[0].  In order to ensure that
the path is *exactly* the same, it is recommended to invoke the
process with ``argv=[]``.'

def getenv(self, variable, **kwargs):

    script = ("\nfrom    ctypes    import    *;    libc    =    CDLL('libc.so.6');    print(libc.getenv(%r))\n" % variable)
    with context.local(log_level='error'):
        python = self.which('python')
        if (not python):
            self.error('Python    is    not    installed    on    the    remote    system.')
        io = self.process(['', '-c', script.strip()], executable=python, **kwargs)
        result = io.recvall()
    try:
        return (int(result) & context.mask)
    except:
        self.exception(('Could    not    look    up    environment    variable    %r' % variable))
