Distinguish byte (python2 str type) and unicode strings (python 3 str type)
Python 3 strings are python 2 unicode strings. Therefore consistently mark strings that are sent via pipes or written/read to file as byte strings.
This commit is contained in:
parent
0d8d19437e
commit
e239820afd
4 changed files with 7 additions and 7 deletions
|
|
@ -246,7 +246,7 @@ if len(sys.argv) != 3:
|
|||
|
||||
infile = sys.argv[1]
|
||||
htmlfile = sys.argv[2]
|
||||
lines += open(infile).read().decode('utf8').split('\n')
|
||||
lines += open(infile, 'rb').read().decode('utf8').split('\n')
|
||||
|
||||
# parse pandoc-style document headers (not part of markdown)
|
||||
g = re.match(r'^%\s+(.*?)\((.*?)\)\s+(.*)$', lines[0])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue