2344: post-review crashes if the home directory is not writable

ALD****@gmai***** (Google Code) (Is this you? Claim this profile.)
Feb. 12, 2012
What version are you running?
RBTools 0.3.2

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


What steps will reproduce the problem?
1. Log in as user without write permission in $HOME folder
2. Attempt to use post-review


What is the expected output? What do you see instead?

Expected Output: None

Actual Output:
Traceback (most recent call last):
  File "/usr/bin/post-review", line 7, in ?
    sys.exit(
  File "/usr/lib/python2.4/site-packages/RBTools-0.3.2-py2.4.egg/rbtools/postreview.py", line         3794, in main
  File "/usr/lib/python2.4/site-packages/RBTools-0.3.2-py2.4.egg/rbtools/postreview.py", line         3415, in tempt_fate
  File "/usr/lib/python2.4/site-packages/RBTools-0.3.2-py2.4.egg/rbtools/postreview.py", line         672, in set_review_request_field
  File "/usr/lib/python2.4/site-packages/RBTools-0.3.2-py2.4.egg/rbtools/postreview.py", line         991, in api_put
  File "/usr/lib/python2.4/site-packages/RBTools-0.3.2-py2.4.egg/rbtools/postreview.py", line         938, in http_put
  File "/usr/lib64/python2.4/_MozillaCookieJar.py", line 117, in save
    f = open(filename, "w")
IOError: [Errno 13] Permission denied: '/var/www/.post-review-cookies.txt'


What operating system are you using? What browser?

Redhat 5, No browser


Please provide any additional information below.

The following fix from Bug #1557 needs to be expanded to new places in reviewboard.py where self.cookie_jar.save(self.cookie_file) is used.

     rsp = urllib2.urlopen(url).read()
-    self.cookie_jar.save(self.cookie_file)
+    try:
+        self.cookie_jar.save(self.cookie_file)
+    except IOError, e:
+        debug('Failed to write cookie file: %s' % e)
     return rsp
david
#1 david
Fixed in release-0.3.x (ade9fe0) and master (1356362). Thanks!
  • +Fixed