mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-02-17 06:00:42 +01:00
src/registry.py: Fix encoding issues with Python 3.
This commit is contained in:
parent
d4f5c03b3f
commit
f1165333e5
@ -113,7 +113,7 @@ def close(registry, filename, private=True):
|
|||||||
for (name, value) in registry.getValues(getChildren=True):
|
for (name, value) in registry.getValues(getChildren=True):
|
||||||
help = value.help()
|
help = value.help()
|
||||||
if help:
|
if help:
|
||||||
lines = textwrap.wrap(value._help.encode('utf8', errors='replace'))
|
lines = textwrap.wrap(value._help)
|
||||||
for (i, line) in enumerate(lines):
|
for (i, line) in enumerate(lines):
|
||||||
lines[i] = '# %s\n' % line
|
lines[i] = '# %s\n' % line
|
||||||
lines.insert(0, '###\n')
|
lines.insert(0, '###\n')
|
||||||
@ -374,7 +374,7 @@ class Value(Group):
|
|||||||
return repr(self())
|
return repr(self())
|
||||||
|
|
||||||
def serialize(self):
|
def serialize(self):
|
||||||
return encoder(str(self))[0]
|
return encoder(str(self))[0].decode()
|
||||||
|
|
||||||
# We tried many, *many* different syntactic methods here, and this one was
|
# We tried many, *many* different syntactic methods here, and this one was
|
||||||
# simply the best -- not very intrusive, easily overridden by subclasses,
|
# simply the best -- not very intrusive, easily overridden by subclasses,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user