1800: Error uploading updated diff

12gaug******@gmai***** (Google Code) (Is this you? Claim this profile.)
Jan. 30, 2012
What version are you running?
1.5 RC1 (current Reviewboard.org version at reviews.reviewboard.org)

What's the URL of the page containing the problem?
http://reviews.reviewboard.org/r/1766/

What steps will reproduce the problem?
1. Change a file
2. Create a diff from Git with:  git diff --full-index >> rev.diff
3. Create a review request from rev.diff
4. Commit the change with:  git commit -a
5. Make another change to the file.
6. Create another diff from Git with:  git diff --full-index >> rev2.diff
7. Update the diff on the review request with the new rev2.diff
8. Error:

Environment: Request Method: POST Request URL: http://reviews.reviewboard.org/api/json/reviewrequests/1766/diff/new/ Django Version: 1.2.1 Python Version: 2.5.2 Installed Applications: ['django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.markup', 'django.contrib.sites', 'django.contrib.sessions', 'djblets.datagrid', 'djblets.feedview', 'djblets.log', 'djblets.siteconfig', 'djblets.util', 'djblets.webapi', 'reviewboard.accounts', 'reviewboard.admin', 'reviewboard.changedescs', 'reviewboard.diffviewer', 'reviewboard.iphone', 'reviewboard.notifications', 'reviewboard.reports', 'reviewboard.reviews', 'reviewboard.scmtools', 'reviewboard.webapi', 'django_evolution'] Installed Middleware: ('django.middleware.gzip.GZipMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.doc.XViewMiddleware', 'django.middleware.http.ConditionalGetMiddleware', 'django.middleware.locale.LocaleMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'djblets.siteconfig.middleware.SettingsMiddleware', 'reviewboard.admin.middleware.LoadSettingsMiddleware', 'djblets.log.middleware.LoggingMiddleware', 'reviewboard.admin.middleware.CheckUpdatesRequiredMiddleware', 'reviewboard.admin.middleware.X509AuthMiddleware') Traceback: File "/usr/lib/python2.5/site-packages/Django-1.2.1-py2.5.egg/django/core/handlers/base.py" in get_response 100. response = callback(request, *callback_args, **callback_kwargs) File "/usr/lib/python2.5/site-packages/Django-1.2.1-py2.5.egg/django/views/decorators/cache.py" in _wrapped_view_func 70. add_never_cache_headers(response) File "/usr/lib/python2.5/site-packages/Django-1.2.1-py2.5.egg/django/utils/cache.py" in add_never_cache_headers 116. patch_response_headers(response, cache_timeout=-1) File "/usr/lib/python2.5/site-packages/Django-1.2.1-py2.5.egg/django/utils/cache.py" in patch_response_headers 105. response['ETag'] = '"%s"' % md5_constructor(response.content).hexdigest() File "/usr/lib/python2.5/site-packages/Djblets-0.6.4alpha0.dev_20100830-py2.5.egg/djblets/webapi/core.py" in _get_content 270. content = adapter.encode(self.api_data, request=self.request) File "/usr/lib/python2.5/site-packages/Djblets-0.6.4alpha0.dev_20100830-py2.5.egg/djblets/webapi/core.py" in encode 119. self.__encode(o, *args, **kwargs) File "/usr/lib/python2.5/site-packages/Djblets-0.6.4alpha0.dev_20100830-py2.5.egg/djblets/webapi/core.py" in __encode 136. self.__encode(value, *args, **kwargs) File "/usr/lib/python2.5/site-packages/Djblets-0.6.4alpha0.dev_20100830-py2.5.egg/djblets/webapi/core.py" in __encode 162. raise TypeError("%r is not XML serializable" % (o,)) Exception Type: TypeError at /api/json/reviewrequests/1766/diff/new/ Exception Value: 1877L is not XML serializable

What is the expected output? What do you see instead?
Should update the review with the newly submit diff

What operating system are you using? What browser?
Windows 7, Chrome 5

Please provide any additional information below.
Tried applying the diff as a delta from the first change, and as a delta from the original version, same error.  Tried including the original diff as the parent diff, same error.
chipx86
#1 chipx86
Which repository is this to?

Can you provide the diffs you tried using here?
  • +NeedInfo
#2 12gaug******@gmai***** (Google Code) (Is this you? Claim this profile.)
This is the original diff...
  • +
    diff --git a/rbtools/postreview.py b/rbtools/postreview.py
    --- a/rbtools/postreview.py
    +++ b/rbtools/postreview.py
    @@ -1465,6 +1465,9 @@ class PerforceClient(SCMClient):
             if options.p4_port:
                os.environ['P4PORT'] = options.p4_port
     
    +        if options.p4_passwd:
    +            os.environ['P4PASSWD'] = options.p4_passwd
    +
             changenum = self.get_changenum(args)
             if changenum is None:
                 return self._path_diff(args)
    @@ -1635,8 +1638,15 @@ class PerforceClient(SCMClient):
                 v = self.p4d_version
     
                 if v[0] < 2002 or (v[0] == "2002" and v[1] < 2):
    -                description = execute(["p4", "describe", "-s", changenum],
    -                                      split_lines=True)
    +                describeCmd = ["p4"]
    +
    +                if options.p4_passwd:
    +                    describeCmd.append("-P")
    +                    describeCmd.append(options.p4_passwd)
    +
    +                describeCmd = describeCmd
#3 12gaug******@gmai***** (Google Code) (Is this you? Claim this profile.)
This is the updated diff...
  • +
    diff --git a/rbtools/postreview.py b/rbtools/postreview.py
    index 5bd1f64b0be70ed0af98abef802b8f8032f80cca..64117d0704302873bde584a4e0e9a2a2f13677ea 100755
    --- a/rbtools/postreview.py
    +++ b/rbtools/postreview.py
    @@ -1879,8 +1896,17 @@ class PerforceClient(SCMClient):
             the file readonly and that causes a later call to unlink fail. So we
             make the file read/write.
             """
    +		
    +        printCmd = ["p4"]
    +
    +        if options.p4_passwd:
    +            printCmd.append("-P")
    +            printCmd.append(options.p4_passwd)
    +
    +        printCmd = printCmd + ["print", "-o", tmpfile, "-q", depot_path]
    +		
             debug('Writing "%s" to "%s"' % (depot_path, tmpfile))
    -        execute(["p4", "print", "-o", tmpfile, "-q", depot_path])
    +        execute(printCmd)
             os.chmod(tmpfile, stat.S_IREAD | stat.S_IWRITE)
     
         def _depot_to_local(self, depot_path):
#4 12gaug******@gmai***** (Google Code) (Is this you? Claim this profile.)
Any thoughts on this?  I'd like to make sure these changes get into the next release.
david
#5 david
  • -NeedInfo
    +New
david
#6 david
  • +Component-API
david
#7 david
This TypeError was fixed in change 8b452523334772f0692509f3407f1275614f0a70
  • -New
    +Fixed