]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commit
Appease req.setHeader by passing bytes, not ints. 137/head
authorBrian Warner <warner@lothar.com>
Wed, 21 Jan 2015 18:31:31 +0000 (10:31 -0800)
committerBrian Warner <warner@lothar.com>
Wed, 21 Jan 2015 18:31:31 +0000 (10:31 -0800)
commit38a4acd623104a76f5d8f90f29002ef0ccf07aa2
tree0a49d8e89879f0bbc516acaadf5c514839bd0c9f
parentcfec3ef002503278c00dd4295f509a45e4e1313d
Appease req.setHeader by passing bytes, not ints.

twisted.web.http.Request.setHeader() really wants a "bytes" object, but
we've been passing integers like len(body). Twisted-12.3 started to
complain about this (with a DeprecationWarning), but the warning is
usually silenced because py2.7 disables deprecations by default.

This fixes Tahoe's misbehavior, but others remain (in Nevow, at least).
I plan to set up some tooling to run tests with
PYTHONWARNINGS=default::DeprecationWarning and collect others. We won't
be able to fix the ones that occur outside of Tahoe, but at least we
should be able to fix our own.

refs ticket:2312
src/allmydata/web/common.py
src/allmydata/web/filenode.py