[tahoe-lafs-trac-stream] [tahoe-lafs] #1581: Trac file uploads/attachments failing

tahoe-lafs trac at tahoe-lafs.org
Sat Nov 12 19:47:56 UTC 2011


#1581: Trac file uploads/attachments failing
------------------------------------+--------------------------------
     Reporter:  warner              |      Owner:  zooko
         Type:  defect              |     Status:  new
     Priority:  major               |  Milestone:  soon (release n/a)
    Component:  dev-infrastructure  |    Version:  n/a
   Resolution:                      |   Keywords:
Launchpad Bug:                      |
------------------------------------+--------------------------------

Comment (by warner):

 The !UnicodeDecodeError looks like it's coming from a part of Trac that
 handles form POST arguments,

 {{{
 File "/usr/local/lib/python2.6/dist-
 packages/Trac-0.12.2-py2.6.egg/trac/web/api.py",
   line 572, in _parse_arg_list:

         args = []
         for value in fs.list or ():
             name = value.name
             if not value.filename:
                 try:
                     value = unicode(value.value, 'utf-8')
                 except UnicodeDecodeError, e:
                     e.args = tuple(e.args + (name, repr(value.value),))
                     raise
             args.append((name, value))
         return args
  }}}

 What I think is happening here is that file uploads use MIME-Multipart,
 so each body section can have a couple of attributes in addition to the
 actual value. "name" is one such attribute, as is "filename". I'm
 guessing that the Trac code assumes that any attachment that doesn't
 have a filename must be a UTF8-encoded unicode string. If that's the
 case, then it implies that Trac is not seeing a {{{filename=}}}
 attribute on the main file's MIME-Multipart body. This could be a result
 of nginx/uwsgi removing it, or something odd happening in my browser
 such that it's not sending it.

-- 
Ticket URL: <https://tahoe-lafs.org/trac/tahoe-lafs/ticket/1581#comment:1>
tahoe-lafs <https://tahoe-lafs.org>
secure decentralized storage


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