[tahoe-lafs-trac-stream] [Tahoe-LAFS] #2312: DeprecationWarning about passing non-bytes header values

Tahoe-LAFS trac at tahoe-lafs.org
Wed Jan 21 00:46:50 UTC 2015


#2312: DeprecationWarning about passing non-bytes header values
------------------------+--------------------------------------------------
     Reporter:  daira   |      Owner:  warner
         Type:  defect  |     Status:  new
     Priority:  minor   |  Milestone:  1.10.1
    Component:  code    |    Version:  1.10.0
   Resolution:          |   Keywords:  DeprecationWarning cygwin tests easy
Launchpad Bug:          |
------------------------+--------------------------------------------------

Comment (by warner):

 A minimal STR is to test `test_web.Web.test_GET_DIRURL_json` under
 python2.6 .

 It turns out that the twisted.web code is expecting the `Content-Length`
 header to contain bytes (like all other headers, who knew?). Three Tahoe
 code paths (in web/common.py and web/filenode.py) fill it with an integer,
 which takes advantage of a `("%s" % value)` fallback.

 A !DeprecationWarning to complain about non-bytes was added in
 Twisted-12.3, probably to guard against unicode header values, but in this
 case it's triggering on our `IntType`. Twisted-12.3 is also when
 `twisted.python.compat.intToBytes(n)` was added to make this easier, but
 it isn't present in 11.0-12.2, which is what we use on windows. So we'll
 need our own `intToBytes` function.

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


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