Skip to content

Commit

Permalink
Fix some more str/bytes issues.
Browse files Browse the repository at this point in the history
Turns out, the source of a DTML document should be text, and only
when rendered out over the publisher be turned into bytes.
  • Loading branch information
hannosch committed May 15, 2017
1 parent 6ca1e9e commit a6eda1c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/DocumentTemplate/DT_String.py
Expand Up @@ -292,7 +292,7 @@ def parse_close(self, text, start, tagre, stag, sloc, scommand, sa):
shared_globals__roles__ = ()
shared_globals = {}

def __init__(self, source_string=b'', mapping=None, __name__='<string>',
def __init__(self, source_string='', mapping=None, __name__='<string>',
**vars):
"""\
Create a document template from a string.
Expand Down
4 changes: 2 additions & 2 deletions src/TreeDisplay/TreeTag.py
Expand Up @@ -614,7 +614,7 @@ def encode_seq(state):
state = state[:l]

state = state.translate(tplus)
return state
return state.decode('ascii')


def encode_str(state):
Expand Down Expand Up @@ -729,4 +729,4 @@ def tpValuesIds(self, get_items, args,


def oid(self):
return b2a_base64(str(self._p_oid))[:-1]
return b2a_base64(self._p_oid)[:-1].decode('ascii')

0 comments on commit a6eda1c

Please sign in to comment.