[issue8231] Unable to run IDLE without write-access to home directory

2017-12-30 Thread Ned Deily

Ned Deily  added the comment:

> Ned diagnosed #32447 as likely due to the space in the user name.

Actually, that's not what the primary problem was. It was a severely 
misconfigured home directory, both permissions and groups.  I'm not sure how 
that situation was created (possibly through inadvertent sysadmin commands from 
the shell) but it's not something that IDLE needs to worry about; such a 
configuration breaks lots of other system programs.  In other words, the OP's 
system was broken.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8231] Unable to run IDLE without write-access to home directory

2017-12-30 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

Ned diagnosed #32447 as likely due to the space in the user name. What matters 
for this issue is that a) someone can do that and b) IDLE likely could continue 
running anyway.  There might then be problems with saving files from the 
editor, so any warning message should include that possibility.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8231] Unable to run IDLE without write-access to home directory

2017-12-30 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

Another duplicate: #32411, MacOS 10.3.1, user apparently cannot write to home 
dir.  Starting IDLE in terminal results in

 Warning: unable to create user config directory
/Users/Steve Margetts/.idlerc
 Check path and permissions.
 Exiting!

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8231] Unable to run IDLE without write-access to home directory

2017-09-10 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I closed #30918 as a duplicate of this.  It has full 'set' and expanduser info.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8231] Unable to run IDLE without write-access to home directory

2017-07-09 Thread Louie Lu

Louie Lu added the comment:

How about only taking warning when not able to create dir at GetUserCfgDir(), 
then take the permission handler in other place?

e.g. when user trying to save the config in bad dir, pop-out a dialog to tell 
it is permission problem or dir not eixsts...etc.

--
nosy: +louielu

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8231] Unable to run IDLE without write-access to home directory

2017-07-08 Thread Terry J. Reedy

Terry J. Reedy added the comment:

#27534 is about reducing the imports into the user runcode process. Without 
rechecking the reason for each import, I think it possible that this might 
result in config not being indirectly imported.

--
dependencies: +IDLE: Reduce number and time for user process imports

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8231] Unable to run IDLE without write-access to home directory

2017-07-07 Thread Terry J. Reedy

Terry J. Reedy added the comment:


New changeset 552f26680d3806df7c27dd7161fd7d57ac815f78 by terryjreedy in branch 
'3.6':
[3.6] bpo-8231: Call idlelib.IdleConf.GetUserCfgDir only once. (GH-2629) (#2631)
https://github.com/python/cpython/commit/552f26680d3806df7c27dd7161fd7d57ac815f78


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8231] Unable to run IDLE without write-access to home directory

2017-07-07 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
pull_requests: +2696

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8231] Unable to run IDLE without write-access to home directory

2017-07-07 Thread Terry J. Reedy

Terry J. Reedy added the comment:


New changeset 223c7e70e48eb6eed4aab3906fbe32b098faafe3 by terryjreedy in branch 
'master':
bpo-8231: Call idlelib.IdleConf.GetUserCfgDir only once. (#2629)
https://github.com/python/cpython/commit/223c7e70e48eb6eed4aab3906fbe32b098faafe3


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8231] Unable to run IDLE without write-access to home directory

2017-07-07 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
pull_requests: +2694

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8231] Unable to run IDLE without write-access to home directory

2017-07-07 Thread Terry J. Reedy

Terry J. Reedy added the comment:

My second patch did fix that.  I think I will extract that part immediately.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8231] Unable to run IDLE without write-access to home directory

2017-07-07 Thread Terry J. Reedy

Terry J. Reedy added the comment:

> GetUserCfgDir() is called in three places, (buried in one of Mark's posts).  
> On the fact of it, this seems like something that should be fixed.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8231] Unable to run IDLE without write-access to home directory

2017-06-28 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Problems with patching 2.7 are no longer relevant.

To test, we should refactor config so that the attempt to find and access $HOME 
and .idlerc are isolated in a function that can be mocked to simulate various 
problems.

def get_rc():
   """Return a directory path that is readable and writable.

   If not possible, return an error indicator.  
   """

Testing such a function is a different issue, but I would just reuse existing 
code.

--
assignee:  -> terry.reedy
versions: +Python 3.7 -Python 2.7, Python 3.4, Python 3.5

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8231] Unable to run IDLE without write-access to home directory

2015-10-29 Thread Mark Roseman

Mark Roseman added the comment:

Better, but alas still not quite. On further investigation, the issue is that a 
new instance of idleConf is instantiated in the subprocess, which then calls 
mkdtemp() returning a different name. You can see this by doing 'restart shell' 
and noting that it will hit the warning you added in GetUserCfgDir.

There are multiple places that the subprocess does access preferences, so just 
eliminating them is probably not the right way to go.

I'd probably recommend that the user prefs dir be communicated to the 
subprocess somehow. Two suggestions are via adding a command line parameter 
where we launch the subprocess (build_subprocess_arglist), or have the 
subprocess get it via 'remotecall' when it starts up (perhaps in 
MyHandler.handle). Either way this would then need to be communicated to 
idleConf so it uses that directory.

Would there be a preference and/or any other alternatives?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8231] Unable to run IDLE without write-access to home directory

2015-10-29 Thread Terry J. Reedy

Terry J. Reedy added the comment:

OK: call GetUserCfgDir once on creation of idleConf instance and set .userdir 
attribute.  Replace repeated calls in PyShell and Editor with attributes 
accesses.  I tested that, with patch, IDLE starts and rewrites both 
breakpoints.lst and recent-files.lst as appropriate.

--
Added file: http://bugs.python.org/file40893/@cfgdir2.diff

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8231] Unable to run IDLE without write-access to home directory

2015-10-29 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I cannot currently think of any reason why the subprocess *needs* to access 
idleConf, so I want to put this on hold while investigating whether the 
accesses can be eliminated as part of #25507.

--
dependencies: +IDLE: user code 'import tkinter; tkinter.font' should fail

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8231] Unable to run IDLE without write-access to home directory

2015-10-29 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Without being able to make my homedir read-only, I don't, of course, see the 
messages.  Since run does not use idleConf (I am now sure), you should have 
been able to proceed after clicking away the admittedly obnoxious repeat 
messages.  The old extraneous user-process temporary should disappear when you 
restart.  Can you check that?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8231] Unable to run IDLE without write-access to home directory

2015-10-28 Thread Mark Roseman

Mark Roseman added the comment:

Checked on Linux and Mac - doesn't work correctly. mkdtemp() returns a 
different name every time it's called, and GetUserCfgDir() is called in three 
places, meaning we end up with three different tmp directories (which on quick 
examination didn't all get cleaned up at end).

I'd suggest changing it so that GetUserCfgDir() caches its result and returns 
the cached version on subsequent calls. Running out the door so don't have time 
to try this myself right now...

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8231] Unable to run IDLE without write-access to home directory

2015-10-28 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Attached is a patch that I think will work.  I have not tested it because I do 
not know how to make my home directory, and only my home directory, read-only.

Brian, how did you do it?  I now have Win 10.

When I rt click user/terry and select properties, there is a tri-state box "[ ] 
Read-only (Only applies to files in folder)".  It initially has a solid square, 
and changes to blank and checkmark.  Try to apply, there is an unselectable 
grayed-out choice to apply to the directory only and a mandatory choice to also 
apply recursively to all files and subdirectories.  I am loath to do this since 
there are 47000 files (4 in appdate, which seems grossly excessive, but 
that is the report)

I would like this tested anyway at least once on linux and mac.  Testing 
procedure: change name of .idlerc, lock home dir, run installed IDLE from 
command line.  Should exit with message.  Run patched repository IDLE.  Should 
run, reporting temp dir and deleting it on exit.  (Unlock home dir and rename 
.idlerc back).

--
keywords: +patch
Added file: http://bugs.python.org/file40872/@cfgdir.diff

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8231] Unable to run IDLE without write-access to home directory

2015-10-28 Thread Mark Roseman

Mark Roseman added the comment:

Just a note that the 'store things in APPDATA' is issue #24765

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8231] Unable to run IDLE without write-access to home directory

2015-10-27 Thread Mark Roseman

Mark Roseman added the comment:

Can I suggest that this issue continues to be about IDLE not being able to 
write its preferences directory/files due to permissions, and we create a new 
issue for the fact that IDLE is storing it in the wrong place under Windows?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8231] Unable to run IDLE without write-access to home directory

2015-10-27 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Yes, that is what this issue *is* about.  IDLE, like Python itself, expects to 
be run on machines that users can write to normally, that have not been 
crippled by bureaucratic policies, or by users. The editor is useless if the 
user cannot write files somewhere.  None of this is specific to Windows.

Ned's idea of a temporary directory seems easy.  Change the warning and 
replace'raise SystemExit' with 'td = tempfile.TemporaryDirectory(); userDir = 
td.name' (see msg222694).  For 2.7, however, TemporayDirectory is not 
available. For the underlying mkdtemp, the user "is responsible for deleting 
the temporary directory and its contents when done with it."  (I presume 
failure of apps to do this is why temp file cleanup is needed.)  My inclination 
for 2.7 would be to copy a stripped down copy of TemporaryDirectory with just 
the finalizer code.  In fact, since we do not need or want the implicit cleanup 
warning (do we?), we could do that for all versions.

We do not have to accommodate all possibilities. One report, possibly on 
Stackoverflow, was from a user whose home dir and, I presume, appdata dir, were 
on a remote server.  Maybe he also had an offline home dir, I don't remember.  
In any case, IDLE was not happy with the setup.

As I said before, permanently and unconditionally moving user config files on 
Windows will break compatibility with all previous releases, so I would not do 
that unless we decide to break compatibility anyway, for reasons other than 
MS's recommendations.  However, after a general solution is applied we could 
consider in a separate issue using Appdata as future-looking, Windows-specific 
alternative to a temporary directory.  However, this would require careful 
though lest we end up with two userdirs because the non-writability of homedir 
is only temporary.

--
type: behavior -> enhancement

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8231] Unable to run IDLE without write-access to home directory

2015-10-25 Thread Keith Teal

Keith Teal added the comment:

I would also like to add that the location of this directory is not correct for 
Windows software. This directory should be created in %APPDATA% where users by 
default do have write permissions.

If there are plans to ever make this application portable then it should 
support a command line option to specify the location of the configuration as 
well.

--
nosy: +tealduck

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8231] Unable to run IDLE without write-access to home directory

2015-10-25 Thread Keith Teal

Keith Teal added the comment:

Hi Terry,

I did not just make that stuff up on my last post, that is actually the 
standard for Windows applications. Yes, many Linux ports get it wrong but is 
that any reason to ever perpetuate a bad practice?

To see the standards you can download the Windows SDK but to make things easier 
for you here is a link that talks about this: 
http://blogs.msdn.com/b/patricka/archive/2010/03/18/where-should-i-store-my-data-and-configuration-files-if-i-target-multiple-os-versions.aspx

By using non-standard conventions the application is just asking for trouble 
like what is being manifested with this issue. Users will be able to write to 
their %APPDATA% area, no administrator would lock that down as it would cause 
too many applications to fail (Kiosk type installations not included).

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8231] Unable to run IDLE without write-access to home directory

2015-10-25 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Idle is not unique.  Several other apps ported from unix also put .xyx files in 
the home directory on Windows. What is unusual, if not unique, about IDLE is 
the need to run multiple versions. If .idlerc is moved, already released 
versions will not be able to access it.  I am not ready to make a break yet.  
In any case, moving it to a subdirectory of $HOME will not solve this issue, 
which is not being able to write to $HOME, and it therefore a different issue.

--
versions: +Python 3.5, Python 3.6 -Python 3.3

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8231] Unable to run IDLE without write-access to home directory

2015-10-01 Thread John Gray

John Gray added the comment:

See Issue14576 which is the same underlying issue.

--
nosy: +John Gray

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8231] Unable to run IDLE without write-access to home directory

2015-09-18 Thread Mark Roseman

Changes by Mark Roseman :


--
nosy: +markroseman

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8231] Unable to run IDLE without write-access to home directory

2014-07-10 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I think the proper solution is to warn Cannot write .idlerc to your home 
directory. Settings will not be saved. and continue.

--
nosy: +terry.reedy

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8231
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8231] Unable to run IDLE without write-access to home directory

2014-07-10 Thread Terry J. Reedy

Terry J. Reedy added the comment:

.idlerc is a directory that contains the user versions of config-xyz.def. There 
are currently 4, another will probably be added.  The 'offending' code is in 
configHandler.IdleConf.GetUserCfgDir() (line 195).
if not os.path.exists(userDir):
try:
os.mkdir(userDir)
except OSError:
warn = ('\n Warning: unable to create user config directory\n'+
userDir+'\n Check path and permissions.\n Exiting!\n\n')
sys.stderr.write(warn)
raise SystemExit

The last line could be replaces by 'return None'.  The calling code that uses 
the normal return would have to be changed to skip trying to read and write the 
config files. According to Ned, Idle already manages if .idlerc exists but is 
unwritable.

The recent files list and breakpoint lists are also stored in .idlerc. Here are 
the 4 hits for 'GetUserCfgDir' in C:\Programs\Python34\Lib\idlelib\*.py ...

EditorWindow.py: 145: self.recent_files_path = 
os.path.join(idleConf.GetUserCfgDir(),
PyShell.py: 131: self.breakpointPath = 
os.path.join(idleConf.GetUserCfgDir(),
configHandler.py: 184: userDir=self.GetUserCfgDir()
configHandler.py: 195: def GetUserCfgDir(self):

While Idle could continue without any of these, I like Brian's idea of asking 
for an alternative first. Actually, if there is no 'home' directory (if 
expanduser('~') below fails), Idle already tries the current directory as a 
backup. It could do the same if a home directory exits but is unusable.

How far should we go with this? A command-line option to set the user cfg dir?  
That should be doable.

I thought about a new idlelib/config-users.def mapping users to directories, 
but that has its own problems of write permission, as will as cross-platform 
access to user name.

The OP (Bryan) asked [is] there is a way to hardcode a reference path that 
doesnt point to my M:\ drive for this directory[?]  Yes. GetUserCfgDir 
starts with
cfgDir = '.idlerc'
userDir = os.path.expanduser('~')
Replace the second line, after each install, to point to a writable directory.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8231
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8231] Unable to run IDLE without write-access to home directory

2014-07-10 Thread Brian Curtin

Changes by Brian Curtin br...@python.org:


--
nosy:  -brian.curtin

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8231
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8231] Unable to run IDLE without write-access to home directory

2014-07-10 Thread Ned Deily

Ned Deily added the comment:

The use case reported here sounds like a classroom or lab environment with many 
people (and likely novices) using open environment machines.  In such cases, if 
users don't have write access to their home directories, it seems to me that 
there's no need to try to preserve IDLE configurations across sessions.  Asking 
the user for another location in such cases would be confusing and add needless 
complexity.  I'd say either just create a temporary directory or create the 
config files as temporary files as needed.  For advanced users, I suppose a 
command line option could be added but has there been any demand for such a 
feature?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8231
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8231] Unable to run IDLE without write-access to home directory

2014-07-10 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I don't know of any request for a new option, so I would go for something 
simple that lets Idle run. Temporary files are a good idea for breakpoints 
(temporary anyway, I think) and maybe for recent files.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8231
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8231] Unable to run IDLE without write-access to home directory

2013-04-29 Thread Ned Deily

Ned Deily added the comment:

Issue17864 is a duplicate of this.  Also, note the error reported here is a 
result of IDLE not having write access in the user's home directory and thus 
cannot create the .idlerc directory.  IDLE seems to handle more gracefully the 
case of .idlerc existing but not writable.

--
nosy: +ned.deily
title: Unable to run IDLE without write-access to config directory - Unable to 
run IDLE without write-access to home directory
versions: +Python 3.4 -Python 2.6, Python 3.2

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8231
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com