Roundup Tracker - Issues

Message6100

Author joseph_myers
Recipients ber, joseph_myers, rouilj
Date 2018-07-01.00:05:33
Message-id <1530403536.18.0.56676864532.issue2550960@psf.upfronthosting.co.za>
In-reply-to
Patches 70 to 73 get to the point where it's possible to do things such
as creating issues and viewing lists of database objects with demo.py
running under Python 3 without exceptions occurring.

70. Python 3 preparation: use // division in HTML templates.

Like patches 25 and 39, but I missed the need for such changes in HTML
templates when preparing those patches.

71. Python 3 preparation: convert dbm keys back from bytes to strings.

The Python 3 dbm module uses bytes for keys and values, converting any
passed in strings to bytes and always returning bytes when keys are
listed or values extracted.  Bytes for values is fine with Roundup
(which uses the marshal module to produce the values stored, which
produces bytes anyway in Python 3), but bytes for keys need converting
back to strings when keys are enumerated.

72. Python 3 preparation: convert string content to bytes for file storage.

When FileClass content comes from a text field in a form rather than an
uploaded file (e.g. creating a msg object in the classic template), this
reaches the blobfiles code as a str object, which thus needs converting
to bytes for storage.

Note that given this fix, while msg objects can be created, they appear
with spurious b'' on the issue pages.  Something needs to handle the
conversion in the other direction as well; I'm not entirely sure what,
but probably the hyperdb property wrapper for any String content
property that is actually stored in a file like this.

(As previously discussed, ideally there might be a distinction between
String and Bytes fields, and then there might be separate text and
binary variants of FileClass.  I haven't attempted to implement any of
that and it should be possible to get Roundup working with Python 3
without needing to do that.)

73. Python 3 preparation: extract full Content-Type header in
roundup_server.py.

This is a fix for code changed in patch 59 and could reasonably be
merged into that patch.  It turns out that for proper parsing of some
form POST submissions, the content type extracted here has to be the
full Content-Type header, including in particular the specified boundary.
History
Date User Action Args
2018-07-01 00:05:36joseph_myerssetmessageid: <1530403536.18.0.56676864532.issue2550960@psf.upfronthosting.co.za>
2018-07-01 00:05:36joseph_myerssetrecipients: + joseph_myers, ber, rouilj
2018-07-01 00:05:36joseph_myerslinkissue2550960 messages
2018-07-01 00:05:34joseph_myerscreate