mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-04-09 03:44:23 +00:00
More Python 3 fixes.
This commit is contained in:
parent
b6788c4439
commit
59847edf9c
@ -1883,7 +1883,7 @@ class Web(WebMixin, WebErrorMixin, testutil.StallMixin, testutil.ReallyEqualMixi
|
||||
# file is SDMF or MDMF
|
||||
d = self.PUT("/uri?format=mdmf",
|
||||
self.NEWFILE_CONTENTS * 300000)
|
||||
d.addCallback(lambda filecap: self.GET("/uri/%s?t=json" % filecap))
|
||||
d.addCallback(lambda filecap: self.GET("/uri/%s?t=json" % unicode(filecap, "ascii")))
|
||||
def _got_json(raw, version):
|
||||
data = json.loads(raw)
|
||||
assert "filenode" == data[0]
|
||||
@ -1898,12 +1898,12 @@ class Web(WebMixin, WebErrorMixin, testutil.StallMixin, testutil.ReallyEqualMixi
|
||||
d.addCallback(lambda ignored:
|
||||
self.PUT("/uri?format=sdmf",
|
||||
self.NEWFILE_CONTENTS * 300000))
|
||||
d.addCallback(lambda filecap: self.GET("/uri/%s?t=json" % filecap))
|
||||
d.addCallback(lambda filecap: self.GET("/uri/%s?t=json" % unicode(filecap, "ascii")))
|
||||
d.addCallback(_got_json, "SDMF")
|
||||
return d
|
||||
|
||||
def test_GET_FILEURL_json_mdmf(self):
|
||||
d = self.GET("/uri/%s?t=json" % urlquote(self._quux_txt_uri))
|
||||
d = self.GET("/uri/%s?t=json" % urlquote(unicode(self._quux_txt_uri, "ascii")))
|
||||
d.addCallback(self.failUnlessIsQuuxJSON)
|
||||
return d
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
from future.utils import PY3
|
||||
from past.builtins import unicode
|
||||
|
||||
import os
|
||||
import time
|
||||
@ -97,7 +98,7 @@ class URIHandler(resource.Resource, object):
|
||||
either "PUT /uri" to create an unlinked file, or
|
||||
"PUT /uri?t=mkdir" to create an unlinked directory
|
||||
"""
|
||||
t = get_arg(req, "t", "").strip()
|
||||
t = unicode(get_arg(req, "t", "").strip(), "utf-8")
|
||||
if t == "":
|
||||
file_format = get_format(req, "CHK")
|
||||
mutable_type = get_mutable_type(file_format)
|
||||
|
Loading…
x
Reference in New Issue
Block a user