------------------------------------------------------------------------------
To reply, visit https://hellosplat.com/s/beanbag/tickets/4958/
------------------------------------------------------------------------------
New ticket #4958 by david
For Beanbag, Inc. > Review Board
Status: New
Tags: Priority:Medium, Type:Defect
------------------------------------------------------------------------------
Diff error bundle uses wrong string type on Python 3 (bytes vs. unicode)
==============================================================================
# What version are you running?
4.0.5
# What's the URL of the page containing the problem?
Diff error bundle.
# What steps will reproduce the problem?
1. Have a review request with a patch that cannot be applied.
2. Attempt to download the error bundle.
# What is the expected output? What do you see instead?
Bundle view results in this error:
```
Traceback (most recent call last):
File "/venv/lib/python3.8/site-packages/reviewboard/diffviewer/views.py",
line 849, in get
zipfile.writestr('%s.orig' % basename, patch_error.orig_file)
File "/usr/lib/python3.8/zipfile.py", line 1816, in writestr
with self.open(zinfo, mode='w') as dest:
File "/usr/lib/python3.8/zipfile.py", line 1517, in open
return self._open_to_write(zinfo, force_zip64=force_zip64)
File "/usr/lib/python3.8/zipfile.py", line 1614, in _open_to_write
self.fp.write(zinfo.FileHeader(zip64))
TypeError: string argument expected, got 'bytes'
```
Looks like we need to open the ZipFile as binary instead of text. This only
occurs on Python 3 due to Python 2's wishy-washiness with string types.
------------------------------------------------------------------------------
--
You received this message because you are subscribed to the Google Groups
"reviewboard-issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/reviewboard-issues/20220117232051.17055.87676%40ip-10-1-54-209.ec2.internal.