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

2016-06-13 Thread Jarrod Petz

Jarrod Petz added the comment:

eryksun, now I understand this is a bit more challenging because tkinter is the 
underlying library doing this and it is shared by other apps.

Though I still don't feel that just because its been like this since 1995 means 
it should stay this way. This is something which breaks other code following 
the python os.path.expanduser way(and probably other thing looking at the 
evitonmeny HOME). Not all people will try getting to the bottom of why, 
esspecially if they are a new user. It should just work.

Would iy be possible for tkinter to allow the user/app to decide the behavior?

Ie. Have a setting(s)/switch which allows the default behavior of setting and 
using HOME to be overiden.

By doing that existing apps remain unchanged and apps like IDLE could change 
this behavior to whatever they want when they are ready.

I think os.path.expanduser() behavior is by far more logical. Preference 
USERPROFILE if HOME is missing. USERPROFILE on windows is needed to even login. 
HOMEDRIVE/HOMEPATH is not.

--

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



[issue27263] IDLE sets the HOME environment variable breaking scripts

2016-06-07 Thread Jarrod Petz

Jarrod Petz added the comment:

Worked around this by setting HOME to be USERPROFILE before IDLE starts

Rather then change the system/user environment permanently. I edited the Idle 
script which the windows shortcut seems to run below.

C:\Python35\Lib\idlelib\idle.pyw

At the top of the script I added

import os
os.environ['HOME'] = os.environ['USERPROFILE']


--

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



[issue27263] IDLE sets the HOME environment variable breaking scripts

2016-06-07 Thread Jarrod Petz

Jarrod Petz added the comment:

It also makes things none deterministic. As when I am off the domain or my 
network drive H:\ is unavailable it works and uses USERPROFILE.

--

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



[issue27263] IDLE sets the HOME environment variable breaking scripts

2016-06-07 Thread Jarrod Petz

New submission from Jarrod Petz:

It seems IDEL is setting the environment variable 'HOME' on windows. 
Specifically I am on windows 8.1

This is extremly annoying and bad as according the code and doco, 
os.path.expanduser will preference this variable above others such as 
USERPROFILE.
https://docs.python.org/3/library/os.path.html#os.path.expanduser

This is causing scripts/libraries and in my case the AWS SDK boto3/botocore 
modules to break. As they are looking for config files in the users home 
location using os.path resolution order which should be %USERPROFILE% in my 
case as I don't have HOME set. But because idle is setting HOME to what looks 
to be my HOMEPATH and HOMEDRIVE this is making the AWS SDK unable to pickup the 
credential files required.

path = "~/.aws/credentials"
print(os.path.expanduser(path))

Should be
C:\Users\myUserName/.aws/credentials

But is instead
H:\/.aws/credentials

Please stop IDLE from setting this environment variable. Running the same 
scripts with python.exe or pythonw.exe works fine.

--
components: IDLE
messages: 267761
nosy: Jarrod Petz
priority: normal
severity: normal
status: open
title: IDLE sets the HOME environment variable breaking scripts
type: behavior
versions: Python 3.5

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