1944: post-review .reviewboardrc location calculation is not portable in windows

mt02****@gmai***** (Google Code) (Is this you? Claim this profile.)
Jan. 13, 2011
1279
What version are you running?
0.8

What's the URL of the page containing the problem?
-

What steps will reproduce the problem?
1. Put .reviewboardrc in %APPDATA% (for vista this is not "..\Local Settings\Application Data" (it doesn't exist) but something like "C:\Users\<user>\AppData\Roaming", which is not constant, ofcourse.
2. Use post-review and see if it loads the server url correctly.


What is the expected output? What do you see instead?
post-review should load .reviewboardrc from %APPDATA% and not %USERPROFILE%\Local Settings\Application Data

What operating system are you using? What browser?
Windows Vista 

Please provide any additional information below.

To make post-review portable cross windows versions the homepath calculation in post-review.py::main should simply be the "APPDATA" environment variable. Perhaps leave the current calculation as a fallback.

A patch for this has been attached.
--- C:/Python25/Scripts/post-review.py	Thu Jan 13 13:04:56 2011
+++ C:/Python25/Scripts/post-review_patched.py	Thu Jan 13 13:05:16 2011
@@ -2420,7 +2420,10 @@
     return (repository_info, tool)
 
 def main(args):
-    if 'USERPROFILE' in os.environ:
+    #APPDATA should be portable cross windows versions
+    if 'APPDATA' in os.environ:
+        homepath = os.environ['APPDATA']
+    elif 'USERPROFILE' in os.environ:
         homepath = os.path.join(os.environ["USERPROFILE"], "Local Settings",
                                 "Application Data")
     elif 'HOME' in os.environ:
chipx86
#1 chipx86
We need to do a new release, but post-review has used APPDATA in git for a while now.