Fix diff error bundle using wrong string type on Python 3.
Review Request #11960 — Created Jan. 21, 2022 and submitted
This change fixes bug #4958 by changing
zipfile
in
DownloadPatchErrorBundleView
to useBytesIO
instead ofStringIO
, which
makes it work on both Python 2 and 3. Before this change, the view would fail
when Python 3 was used.This change also adds two unit tests for
DownloadPatchErrorBundleView
that test
its response when there is or isn't aPatchError
raised in rendering the diff.
A review request with a patch that does not apply cleanly was created.
The patch error bundle was successfully downloaded when running
the Review Board dev server on both Python 2 and 3.Two unit tests were added for
DownloadPatchErrorBundleView
that test its
responses. It was verified that these unit tests fail onrelease-4.0.x
when Python 3 is used, and pass on both Python 2 and 3 after this change.All unit tests in
reviewboard.diffviewer.tests
were run and passed on
both Python 2 and 3.
Summary | ID |
---|---|
9bc012f456be3361fb47af7bf23a8bcd18054ed2 | |
ef399bd8c618f44b14d262c2e16aee40ad641c30 | |
c30a4b37cd86f66a455a9e76bbda5f7a57514c22 |
Description | From | Last Updated |
---|---|---|
Please add the bug number to the "Bugs" field. |
david | |
Can we add a unit test for this? |
david | |
E501 line too long (83 > 79 characters) |
reviewbot | |
W292 no newline at end of file |
reviewbot | |
Imports in Python are in 3 groups, each separated by a blank line: Standard library imports Third-party modules (from the … |
chipx86 | |
Docstring summaries must be one line. If this can't fit, just simplify the reference to DownloadPatchErrorBundleView. |
chipx86 | |
The trailing """ must be on its own line. Same below. |
chipx86 | |
This can be: self.spy_on(..., op=kgb.SpyOpReturn(HttpResponse())) |
chipx86 | |
Can you group this with the other from ... imports in this import group? Make sure it's grouped alphabetically. |
chipx86 |
- Change Summary:
-
Add bug number to Bugs field
- Bugs:
- Change Summary:
-
Add unit tests to
DownloadPatchErrorBundleView
. - Description:
-
~ This commit fixes bug #4958 by changing
zipfile
in~ This change fixes bug #4958 by changing
zipfile
inDownloadPatchErrorBundleView
to useBytesIO
instead ofStringIO
, which~ makes it work on both Python 2 and 3. ~ makes it work on both Python 2 and 3. Before this change, the view would fail + when Python 3 was used. + + This change also adds two unit tests for
DownloadPatchErrorBundleView
that test+ its response when there is or isn't a PatchError
raised in rendering the diff. - Testing Done:
-
A review request with a patch that does not apply cleanly was created.
The patch error bundle was successfully downloaded when running the Review Board dev server on both Python 2 and 3. + + Two unit tests were added for
DownloadPatchErrorBundleView
that test its+ responses. It was verified that these unit tests fail on release-4.0.x
+ when Python 3 is used, and pass on both Python 2 and 3 after this change. + + All unit tests in
reviewboard.diffviewer.tests
were run and passed on+ both Python 2 and 3. - Commits:
-
Summary ID a46e017b48b5be34cab00737f9d5b7d113fa19a0 a46e017b48b5be34cab00737f9d5b7d113fa19a0 7cfc46ace886a3ed31b2647a2f844470ca068725
- Change Summary:
-
Fix code formatting.
- Commits:
-
Summary ID a46e017b48b5be34cab00737f9d5b7d113fa19a0 7cfc46ace886a3ed31b2647a2f844470ca068725 a46e017b48b5be34cab00737f9d5b7d113fa19a0 fc4da4c6e8c34ed53c8ffe65dcea63452f524088
Checks run (2 succeeded)
-
-
Imports in Python are in 3 groups, each separated by a blank line:
- Standard library imports
- Third-party modules (from the point of view of the application)
- Application modules.
Inside of each group, we order them:
import ...
entries beforefrom ...
entries- Alphabetical within each.
-
Docstring summaries must be one line.
If this can't fit, just simplify the reference to
DownloadPatchErrorBundleView
. -
-
-
Can you group this with the other
from ...
imports in this import group? Make sure it's grouped alphabetically.
- Change Summary:
-
Make requested changes from Christian Hammond's review
- Commits:
-
Summary ID a46e017b48b5be34cab00737f9d5b7d113fa19a0 fc4da4c6e8c34ed53c8ffe65dcea63452f524088 9bc012f456be3361fb47af7bf23a8bcd18054ed2 ef399bd8c618f44b14d262c2e16aee40ad641c30 c30a4b37cd86f66a455a9e76bbda5f7a57514c22