From e658efe3d1b44d7cb7be629446aa3dff1e52fcf4 Mon Sep 17 00:00:00 2001 From: FrantiĊĦek Zatloukal Date: Nov 19 2018 12:55:07 +0000 Subject: Fix building docs with Python 3 --- diff --git a/docs/generate_directive_docs.py b/docs/generate_directive_docs.py index 70cb13d..a97f96a 100644 --- a/docs/generate_directive_docs.py +++ b/docs/generate_directive_docs.py @@ -108,7 +108,7 @@ def write_data(text, options, outputname, module): # Hack the opening of the file to strip ".py" from module names f = open(os.path.join(options.output_dir, outputname % module[:-3]), 'w') - f.write(text.encode('utf-8')) + f.write(text) f.close() else: print(text) @@ -347,7 +347,7 @@ def process_category(category, categories, options, env, template, outputname): category = category.title() modules = module_map.keys() - modules.sort() + modules = sorted(modules) toc_list = [] links_list = [] @@ -471,7 +471,7 @@ def main(): categories = list_modules(options.module_dir) category_names = categories.keys() - category_names.sort() + category_names = sorted(category_names) assert CATEGORY_NAME in category_names # Create the 'directives' directory if it doesn't exist