[tahoe-lafs-trac-stream] [Tahoe-LAFS] #3854: builtins.TypeError: write() argument must be str, not bytes from allmydata/webish.py usage of FileUploadFieldStorage

Tahoe-LAFS trac at tahoe-lafs.org
Tue Jan 4 17:04:01 UTC 2022


#3854: builtins.TypeError: write() argument must be str, not bytes from
allmydata/webish.py usage of FileUploadFieldStorage
-------------------------+-----------------------
     Reporter:  exarkun  |      Owner:  itamarst
         Type:  defect   |     Status:  new
     Priority:  normal   |  Milestone:  undecided
    Component:  unknown  |    Version:  n/a
   Resolution:           |   Keywords:
Launchpad Bug:           |
-------------------------+-----------------------

Comment (by itamarst):

 Ah, so:

 In order to workaround problems in Python 3's decision about whether
 something is bytes or unicode, we implement a heuristic that says "if the
 'name' MIME field of the upload was 'file', assume it's bytes."

 And my guess is that heuristic isn't good enough for all clients, so we
 need some more aggressive heuristic. I guess we could just say "it's
 always bytes"? But that might break some other bits, like the web UI.

--
Ticket URL: <https://tahoe-lafs.org/trac/tahoe-lafs/ticket/3854#comment:3>
Tahoe-LAFS <https://Tahoe-LAFS.org>
secure decentralized storage


More information about the tahoe-lafs-trac-stream mailing list