Terry J. Reedy added the comment:

The current tests do not write anything.  But IDLE currently requires the 
existence of .idlerc to run, and tries to write it if not found.  Changing this 
requirement without disabling multiple features would not be trivial.  On 
possibility might be to replace builtin open with a wrapper that returned named 
StringIO objects when the path began with '.idlerc/'.  The StringIO would have 
to be cached so that closing and reopening the same path got the same object. 
But this is only good for one process. See below.

There are two existing issues, #8231 and #15862, about HOME not being writable 
and not existing.  The first has a patch I wrote 2 years ago trying to do what 
you suggest above.  It used tempfile.mkdtemp for 2.7 compatibility, by I would 
now use TemporaryDirectory. The discussion ended at that time with some 
unresolved issues.

One in particular is that IDLE runs with two processes, with the user execution 
process being based on run.py.  One of the idlelib modules imported by run 
eventually imports config. See msg253681 and msg253714.

The is already a mechanism for test_idle to tell idlelib module 'testing'.  If 
and when #8231 is solved, that mechanism could be used to ignore $HOME.

----------
dependencies: +IDLE: startup problem when HOME does not exist, Unable to run 
IDLE without write-access to home directory

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue30869>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to