Escape backslashes in PEPs when writing an index.yml
This commit is contained in:
parent
d54e5eac4a
commit
69064d13b6
|
@ -428,6 +428,7 @@ def set_up_pyramid(inpath):
|
||||||
def write_pyramid_index(destDir, title):
|
def write_pyramid_index(destDir, title):
|
||||||
filename = os.path.join(destDir, 'index.yml')
|
filename = os.path.join(destDir, 'index.yml')
|
||||||
fp = codecs.open(filename, 'w', 'utf-8')
|
fp = codecs.open(filename, 'w', 'utf-8')
|
||||||
|
title = title.replace('\\', '\\\\') # Escape existing backslashes
|
||||||
fp.write(INDEX_YML % title.replace('"', '\\"'))
|
fp.write(INDEX_YML % title.replace('"', '\\"'))
|
||||||
fp.close()
|
fp.close()
|
||||||
os.chmod(filename, 0664)
|
os.chmod(filename, 0664)
|
||||||
|
|
Loading…
Reference in New Issue