diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-09-29 16:11:58 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-09-29 16:11:58 +0400 |
commit | 081543fee812c94c883329bf3917071e0f770fb4 (patch) | |
tree | defc88cdbf0b0938e912a195df39ceeced5b8675 /doc | |
parent | a81b37e25223c078fbcdb12554a6f89f93bbf48c (diff) |
fix for error generating docs, write all files as utf-8
Diffstat (limited to 'doc')
-rw-r--r-- | doc/python_api/sphinx_doc_gen.py | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/doc/python_api/sphinx_doc_gen.py b/doc/python_api/sphinx_doc_gen.py index ca37030074a..c1bed089b5a 100644 --- a/doc/python_api/sphinx_doc_gen.py +++ b/doc/python_api/sphinx_doc_gen.py @@ -161,7 +161,7 @@ def range_str(val): def example_extract_docstring(filepath): - file = open(filepath, 'r') + file = open(filepath, "r", encoding="utf-8") line = file.readline() line_no = 0 text = [] @@ -360,7 +360,7 @@ def pymodule2sphinx(BASEPATH, module_name, module, title): if module_all: module_dir = module_all - file = open(filepath, "w") + file = open(filepath, "w", encoding="utf-8") fw = file.write @@ -510,7 +510,7 @@ def pycontext2sphinx(BASEPATH): # Only use once. very irregular filepath = os.path.join(BASEPATH, "bpy.context.rst") - file = open(filepath, "w") + file = open(filepath, "w", encoding="utf-8") fw = file.write fw("Context Access (bpy.context)\n") fw("============================\n\n") @@ -698,7 +698,7 @@ def pyrna2sphinx(BASEPATH): # return filepath = os.path.join(BASEPATH, "bpy.types.%s.rst" % struct.identifier) - file = open(filepath, "w") + file = open(filepath, "w", encoding="utf-8") fw = file.write base_id = getattr(struct.base, "identifier", "") @@ -912,7 +912,7 @@ def pyrna2sphinx(BASEPATH): def fake_bpy_type(class_value, class_name, descr_str, use_subclasses=True): filepath = os.path.join(BASEPATH, "bpy.types.%s.rst" % class_name) - file = open(filepath, "w") + file = open(filepath, "w", encoding="utf-8") fw = file.write write_title(fw, class_name, "=") @@ -963,7 +963,7 @@ def pyrna2sphinx(BASEPATH): for op_module_name, ops_mod in op_modules.items(): filepath = os.path.join(BASEPATH, "bpy.ops.%s.rst" % op_module_name) - file = open(filepath, "w") + file = open(filepath, "w", encoding="utf-8") fw = file.write title = "%s Operators" % op_module_name.replace("_", " ").title() @@ -1017,7 +1017,7 @@ def rna2sphinx(BASEPATH): # conf.py - empty for now filepath = os.path.join(BASEPATH, "conf.py") - file = open(filepath, "w") + file = open(filepath, "w", encoding="utf-8") fw = file.write version_string = ".".join(str(v) for v in bpy.app.version) @@ -1053,7 +1053,7 @@ def rna2sphinx(BASEPATH): # main page needed for sphinx (index.html) filepath = os.path.join(BASEPATH, "contents.rst") - file = open(filepath, "w") + file = open(filepath, "w", encoding="utf-8") fw = file.write fw("%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n") @@ -1169,7 +1169,7 @@ def rna2sphinx(BASEPATH): # internal modules if "bpy.ops" not in EXCLUDE_MODULES: filepath = os.path.join(BASEPATH, "bpy.ops.rst") - file = open(filepath, "w") + file = open(filepath, "w", encoding="utf-8") fw = file.write fw("Operators (bpy.ops)\n") fw("===================\n\n") @@ -1181,7 +1181,7 @@ def rna2sphinx(BASEPATH): if "bpy.types" not in EXCLUDE_MODULES: filepath = os.path.join(BASEPATH, "bpy.types.rst") - file = open(filepath, "w") + file = open(filepath, "w", encoding="utf-8") fw = file.write fw("Types (bpy.types)\n") fw("=================\n\n") @@ -1194,7 +1194,7 @@ def rna2sphinx(BASEPATH): # not actually a module, only write this file so we # can reference in the TOC filepath = os.path.join(BASEPATH, "bpy.data.rst") - file = open(filepath, "w") + file = open(filepath, "w", encoding="utf-8") fw = file.write fw("Data Access (bpy.data)\n") fw("======================\n\n") @@ -1284,7 +1284,7 @@ def rna2sphinx(BASEPATH): if 0: filepath = os.path.join(BASEPATH, "bpy.rst") - file = open(filepath, "w") + file = open(filepath, "w", encoding="utf-8") fw = file.write fw("\n") |