Skip to content
Snippets Groups Projects
Unverified Commit bcaa9c29 authored by Jean-Paul Calderone's avatar Jean-Paul Calderone Committed by GitHub
Browse files

Merge pull request #232 from PrivateStorageio/225.unicode-does-not-have-the-buffer-interface.2

Fix unicode/bytes handling in Tahoe config code
parents b7d9b00e a0dc0de8
No related branches found
No related tags found
1 merge request!229Set up CI for Tahoe 1.16.x
......@@ -20,8 +20,8 @@ from __future__ import (
absolute_import,
)
from io import (
BytesIO,
from StringIO import (
StringIO,
)
from os import (
makedirs,
......@@ -397,7 +397,17 @@ class ClientPluginTests(TestCase):
b"tub.port",
config_text.encode("utf-8"),
)
config_text = BytesIO()
# On Tahoe-LAFS <1.16, the config is written as bytes.
# On Tahoe-LAFS >=1.16, the config is written as unicode.
#
# So we'll use `StringIO.StringIO` (not `io.StringIO`) here - which
# will allow either type (it will also implicitly decode bytes to
# unicode if we mix them, though I don't think that should happen
# here).
#
# After support for Tahoe <1.16 support is dropped we probably want to
# switch to an io.StringIO here.
config_text = StringIO()
node_config.config.write(config_text)
self.addDetail(u"config", text_content(config_text.getvalue()))
self.addDetail(u"announcement", text_content(unicode(announcement)))
......
......@@ -34,15 +34,17 @@ buildPythonPackage rec {
];
propagatedBuildInputs = [
attrs
zope_interface
aniso8601
# Inherit eliot from tahoe-lafs
# eliot
twisted
tahoe-lafs
challenge-bypass-ristretto
treq
# Inherit some things from tahoe-lafs to avoid conflicting versions
#
# attrs
# zope_interface
# twisted
# eliot
# treq
];
checkInputs = [
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment