[docs] [issue27263] Tkinter sets the HOME environment variable, breaking scripts

Terry J. Reedy report at bugs.python.org
Mon Jun 13 21:11:29 EDT 2016

Terry J. Reedy added the comment:

How about wrapping the appropriate tkinter code with (untested yet)

import os
HOME = os.environ['HOME']
    <run tkinter>
    os.environ['HOME'] = HOME  # will this unset?

or use a restore_env('HOME', ...) context manager?

Revising os.expanduser or apps to ignore HOME while tk is running is a related but different issue.


Python tracker <report at bugs.python.org>

More information about the docs mailing list