Open all binary files as binary and save to storage using basenames.

Review Request #10481 — Created March 31, 2019 and submitted — Latest diff uploaded

Information

Review Board
release-4.0.x

Reviewers

This updates our various file opening calls to explicitly open any
binary files as binary. While not a real problem on Python 2.x, Python
3.x requires this in order to get byte strings out instead of Unicode
strings.

It also ensures that any time we write a file using a Django storage
backend, we're providing a basename and not a file path, in order to
avoid issues on Django 1.11.

Unit tests pass on Python 2.7 with Django 1.6 and 3.5-3.7 with
Django 1.11 (with other in-progress changes).

Diff Revision 1 (Latest)

Commits

First Last Summary ID Author
Open all binary files as binary.
This updates our various file opening calls to explicitly open any binary files as binary. While not a real problem on Python 2.x, Python 3.x requires this in order to get byte strings out instead of Unicode strings.
b46a3996cff39c038840d852bc9147b72aeb9ba7 Christian Hammond
reviewboard/attachments/tests.py
reviewboard/diffviewer/diffutils.py
reviewboard/scmtools/tests/test_git.py
reviewboard/testing/testcase.py
reviewboard/webapi/tests/test_change.py
reviewboard/webapi/tests/test_draft_filediff.py
reviewboard/webapi/tests/test_file_attachment.py
reviewboard/webapi/tests/test_file_attachment_draft.py
reviewboard/webapi/tests/test_screenshot.py
reviewboard/webapi/tests/test_screenshot_draft.py
reviewboard/webapi/tests/test_user_file_attachment.py
reviewboard/webapi/tests/test_validate_diff.py
Loading...