Some Unicode fixes for Python 3
This commit is contained in:
parent
e38ccc7190
commit
ea2ef9876d
|
@ -188,7 +188,7 @@ def write_json(path, data):
|
||||||
flock(fh, LOCK_EX)
|
flock(fh, LOCK_EX)
|
||||||
|
|
||||||
# Write it.
|
# Write it.
|
||||||
fh.write(json.dumps(data, sort_keys=True, indent=4, separators=(',', ': ')))
|
fh.write(json.dumps(data, indent=4, separators=(',', ': ')))
|
||||||
|
|
||||||
# Unlock and close.
|
# Unlock and close.
|
||||||
flock(fh, LOCK_UN)
|
flock(fh, LOCK_UN)
|
||||||
|
|
|
@ -8,6 +8,11 @@ import time
|
||||||
import re
|
import re
|
||||||
import glob
|
import glob
|
||||||
import os
|
import os
|
||||||
|
import sys
|
||||||
|
|
||||||
|
if sys.version_info[0] > 2:
|
||||||
|
def unicode(s):
|
||||||
|
return s
|
||||||
|
|
||||||
from rophako.settings import Config
|
from rophako.settings import Config
|
||||||
import rophako.jsondb as JsonDB
|
import rophako.jsondb as JsonDB
|
||||||
|
|
|
@ -19,6 +19,11 @@ from rophako.plugin import load_plugin
|
||||||
from rophako.settings import Config
|
from rophako.settings import Config
|
||||||
from rophako.log import logger
|
from rophako.log import logger
|
||||||
|
|
||||||
|
import sys
|
||||||
|
if sys.version_info[0] > 2:
|
||||||
|
def unicode(s):
|
||||||
|
return str(s)
|
||||||
|
|
||||||
mod = Blueprint("blog", __name__, url_prefix="/blog")
|
mod = Blueprint("blog", __name__, url_prefix="/blog")
|
||||||
load_plugin("rophako.modules.comment")
|
load_plugin("rophako.modules.comment")
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user