[Python-Dev] py.ini documentation improvement

309 views
Skip to first unread message

Tim Delaney

unread,
Nov 28, 2013, 4:04:24 PM11/28/13
to Python-Dev
I was just getting Jython working with py.exe, and I think the documentation can be made a bit more friendly. In particular think we can make it easier for people to determine the correct folder by changing the line in 3.4.4.1 Customization via INI files:

Two .ini files will be searched by the launcher - py.ini in the current user’s "application data" directory (i.e. the directory returned by calling the Windows function SHGetFolderPath with CSIDL_LOCAL_APPDATA) and py.ini in the same directory as the launcher.

to

Two .ini files will be searched by the launcher - py.ini in the current user’s "application data" directory (i.e. the directory returned by executing `echo %LOCALAPPDATA%` in a command window) and py.ini in the same directory as the launcher.

%LOCALAPPDATA% should always contain the same value as would be returned from SHGetFolderPath with CSIDL_LOCAL_APPDATA.

Tim Delaney

Glenn Linderman

unread,
Nov 28, 2013, 4:34:07 PM11/28/13
to pytho...@python.org
On 11/28/2013 1:04 PM, Tim Delaney wrote:

%LOCALAPPDATA% should always contain the same value as would be returned from SHGetFolderPath with CSIDL_LOCAL_APPDATA.
Except when it gets changed. Documentation should reflect the actual use in the code. If it uses the SHGetFolderPath, that is what should be documented; if it uses the environment variable, that is what should get documented. Users can easily change the environment variable (which might be a reason to use it, instead of SHGetFolderPath).

Tim Delaney

unread,
Nov 28, 2013, 4:45:42 PM11/28/13
to Python-Dev
Didn't think of that - good point.

Tim Delaney

Terry Reedy

unread,
Nov 28, 2013, 5:25:17 PM11/28/13
to pytho...@python.org
On 11/28/2013 4:04 PM, Tim Delaney wrote:
> I was just getting Jython working with py.exe, and I think the
> documentation can be made a bit more friendly. In particular think we
> can make it easier for people to determine the correct folder by
> changing the line in 3.4.4.1 Customization via INI files:
>
> Two .ini files will be searched by the launcher - py.ini in the current
> user’s "application data" directory (i.e. the directory returned by
> calling the Windows function SHGetFolderPath with CSIDL_LOCAL_APPDATA)
> and py.ini in the same directory as the launcher.
>
> to
>
> Two .ini files will be searched by the launcher - py.ini in the current
> user’s "application data" directory (i.e. the directory returned by
> executing `echo %LOCALAPPDATA%` in a command window) and py.ini in the
> same directory as the launcher.

'Two .ini files will be searched by the launcher' sort of implies to me
that the files exist. On my Win7 machine, echo %LOCALAPPDATA% returns
C:\Users\Terry\AppData\Local. If I go to Users/Terry with Explorer,
there is no AppData. (Same with admin user.) C:\Windows contains
py(w).exe, but no py.ini. Clearer would be

The launcher will search for py.ini in two possible places -- first in
the same directory as the launcher; second in the current user's
"application data" directory <whatever is said about how to find it>.

I am pretty sure that order is important and that my version, not the
current version, is correct.

--
Terry Jan Reedy


_______________________________________________
Python-Dev mailing list
Pytho...@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: https://mail.python.org/mailman/options/python-dev/dev-python%2Bgarchive-30976%40googlegroups.com

mar...@v.loewis.de

unread,
Nov 28, 2013, 5:35:14 PM11/28/13
to pytho...@python.org

Quoting Terry Reedy <tjr...@udel.edu>:

> 'Two .ini files will be searched by the launcher' sort of implies to
> me that the files exist. On my Win7 machine, echo %LOCALAPPDATA%
> returns C:\Users\Terry\AppData\Local. If I go to Users/Terry with
> Explorer, there is no AppData. (Same with admin user.)

Are you sure about this? What happens if you type "%LOCALAPPDATA%"
(without quotes) into the explorer's address bar?

Regards,
Martin

Terry Reedy

unread,
Nov 28, 2013, 6:59:14 PM11/28/13
to pytho...@python.org
On 11/28/2013 5:35 PM, mar...@v.loewis.de wrote:
>
> Quoting Terry Reedy <tjr...@udel.edu>:
>
>> 'Two .ini files will be searched by the launcher' sort of implies to
>> me that the files exist. On my Win7 machine, echo %LOCALAPPDATA%
>> returns C:\Users\Terry\AppData\Local. If I go to Users/Terry with
>> Explorer, there is no AppData. (Same with admin user.)

I initially intended to write "there is no AppData *visible*". Then I
switched to my win7 admin account and there was still no AppData
visible, for any user. This is unlike with XP where things not visible
to 'users' become visible as admin.

> What happens if you type "%LOCALAPPDATA%"
> (without quotes) into the explorer's address bar?

It displays C:\Users\Terry\AppData\Local on the bar and the contents in
the box below. The py.ini doc might mention this as a way to get there.
Thanks.

--
Terry Jan Reedy

Tim Delaney

unread,
Nov 28, 2013, 7:06:24 PM11/28/13
to Python-Dev
On 29 November 2013 10:59, Terry Reedy <tjr...@udel.edu> wrote:
On 11/28/2013 5:35 PM, mar...@v.loewis.de wrote:

Quoting Terry Reedy <tjr...@udel.edu>:

'Two .ini files will be searched by the launcher' sort of implies to
me that the files exist. On my Win7 machine, echo %LOCALAPPDATA%
returns C:\Users\Terry\AppData\Local. If I go to Users/Terry with
Explorer, there is no AppData. (Same with admin user.)

I initially intended to write "there is no AppData *visible*". Then I switched to my win7 admin account and there was still no AppData visible, for any user. This is unlike with XP where things not visible to 'users' become visible as admin.

By default in Win7 AppData is a hidden folder - you need to go to  Tools | Folder Options | View | Show hidden files, folders and drives to see it in Explorer (no matter what user you're logged in as).

If the py.ini location does become defined in terms of %LOCALAPPDATA% then suggesting to use that value in the Explorer address bar would probably be the easiest way for people to get to the correct directory.

Tim Delaney

Terry Reedy

unread,
Nov 28, 2013, 9:17:43 PM11/28/13
to pytho...@python.org
On 11/28/2013 7:06 PM, Tim Delaney wrote:

> By default in Win7 AppData is a hidden folder - you need to go to Tools

On my system, that is Control Panel, not Tools.

> | Folder Options | View | Show hidden files, folders and drives to see
> it in Explorer (no matter what user you're logged in as).

Thanks, done (and another desired change made also).

> If the py.ini location does become defined in terms of %LOCALAPPDATA%
> then suggesting to use that value in the Explorer address bar would
> probably be the easiest way for people to get to the correct directory.

Tim Delaney

unread,
Nov 28, 2013, 9:27:57 PM11/28/13
to Python-Dev
On 29 November 2013 13:17, Terry Reedy <tjr...@udel.edu> wrote:
On 11/28/2013 7:06 PM, Tim Delaney wrote:

By default in Win7 AppData is a hidden folder - you need to go to  Tools

On my system, that is Control Panel, not Tools.

Sorry - was referring to the Explorer "Tools" menu, which is likewise hidden by default ... so many things that I change from the defaults when setting up a Windows machine - it's become so automatic that I forget what is hidden from most users.

Tim Delaney 

Nick Coghlan

unread,
Nov 28, 2013, 9:38:23 PM11/28/13
to Tim Delaney, Python-Dev
Turning my Windows gaming machine back to the default settings and
trying to bootstrap pip was one of the key things that got me
motivated to work on PEP 453. It still astounds me that one company
can both create Visual Studio, *and* make it difficult to configure a
machine to be suitable for software development, but I guess that's
enterprise companies for you :)

Cheers,
Nick.

--
Nick Coghlan | ncog...@gmail.com | Brisbane, Australia

Stephen J. Turnbull

unread,
Nov 28, 2013, 10:55:54 PM11/28/13
to Nick Coghlan, Tim Delaney, Python-Dev
Nick Coghlan writes:

> Turning my Windows gaming machine back to the default settings and
> trying to bootstrap pip was one of the key things that got me
> motivated to work on PEP 453. It still astounds me that one company
> can both create Visual Studio, *and* make it difficult to configure a
> machine to be suitable for software development, but I guess that's
> enterprise companies for you :)

Those of us who study management for a living are definitely not
surprised. I recommend Robert Townsend's "Call Yourself Up" from _Up
the Organization_: he advises CEOs to ring up the company's toll-free
number and find out what the customers deal with. Urk!

This is the "same s---, different dept", that's all. And it's a lot
harder to avoid than most folks think.

Kudos to Nick for "calling himself up", to python-dev for creating a
language and development ecology with so few unnecessary barriers, and
to Guido for setting the tone!
Reply all
Reply to author
Forward
0 new messages