Commit 80afa32
committed
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.)1 parent 566f319 commit 80afa32
1 file changed
+4
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
| 26 | + | |
25 | 27 | | |
26 | 28 | | |
27 | 29 | | |
| |||
332 | 334 | | |
333 | 335 | | |
334 | 336 | | |
| 337 | + | |
| 338 | + | |
335 | 339 | | |
336 | 340 | | |
337 | 341 | | |
| |||
0 commit comments