win32utils.get_home_location used for .bzr.log is incorrect
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Bazaar |
Confirmed
|
Low
|
Unassigned | ||
Breezy |
Fix Released
|
Low
|
Martin Packman |
Bug Description
The above function returns the location of "My Documents" - eg:
>>> from bzrlib.win32utils import get_home_location
>>> get_home_location()
u'D:\\Documents and Settings\\skip\\My Documents'
>>>
I note that this is used to locate the log file. The end result is that our log file ends up in My Documents, which is not appropriate ("My Documents" is a folder for documents created directly by the user - if every software package put its log there, obviously it would be useless for the user. It only *seems* to be appropriate now as bzr is one of the few software packages rude enough to use it this way.)
I'd suggest that either CSIDL_APPDATA or CSIDL_LOCAL_APPDATA be used (the former location "roams" when the user logs into a different machine, while the latter does not - eg, by default, %TEMP% is under the latter.
Alternatively, if it is decided "My documents" really is where we want to put the log file, this function should be renamed - "my documents" should not generally be considered the "home" directory on Win32. get_documents_
Related branches
- Jelmer Vernooij: Approve
-
Diff: 469 lines (+62/-78)12 files modifiedbreezy/bedding.py (+3/-1)
breezy/gpg.py (+1/-1)
breezy/help_topics/__init__.py (+3/-3)
breezy/help_topics/en/missing-extensions.txt (+1/-1)
breezy/tests/__init__.py (+4/-4)
breezy/tests/blackbox/test_version.py (+9/-9)
breezy/trace.py (+12/-17)
breezy/transport/log.py (+2/-2)
doc/developers/apport.txt (+2/-2)
doc/developers/authentication-ring.txt (+1/-1)
doc/developers/integration.txt (+23/-36)
doc/developers/profiling.txt (+1/-1)
Changed in bzr: | |
status: | Triaged → Confirmed |
tags: | added: easy win32 |
summary: |
- bzrlib.win32utils.get_home_location incorrect + win32utils.get_home_location used for .bzr.log is incorrect |
tags: | added: check-for-breezy |
Changed in brz: | |
status: | New → In Progress |
importance: | Undecided → Low |
assignee: | nobody → Martin Packman (gz) |
milestone: | none → 3.1.0 |
Changed in brz: | |
status: | In Progress → Fix Committed |
Changed in brz: | |
status: | Fix Committed → Fix Released |
tags: | removed: check-for-breezy |
Initially we are used os.expand( '~/.bzr. log') regardless of platform. But this will tend to place log either to the root of drive C: or to C:\Documents and Settings\USERNAME depends on HOMEDRIVE and HOMEPATH environment variables. I saw corresponding bug report in Python, but it still non-fixed.
I chose My Documents folder because it much easier to say people when they come with troubles or bug reports: "show me the last part of .bzr.log in your My Documents folder". Just to easy locate this file. This is answer on question "why we use wrong My Documents."
Of course now location of this file shown in output of bzr --version. But when I switch to My Documents it was not. This is my story.