[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']
try:
    <run tkinter>
finally"
    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>
<http://bugs.python.org/issue27263>
_______________________________________


More information about the docs mailing list