Page MenuHome

blender offline python documentation in zipped HTML files, not shown correctly
Closed, ResolvedPublic


System Information

windows 7 ultimate
Google Chrome, Opera
nvidia geforce nforce 430

Blender Version

2.78a python api documentation

Short description of error

when any page in is opened it is not shown correctly and seach fnctionality not works

Exact steps for others to reproduce the error

download the file in:
unpack the zip file
and open any page.

Event Timeline

Brecht Van Lommel (brecht) triaged this task as Confirmed, Medium priority.

@Bastien Montagne (mont29), it can be fixed like this, the zip was not including files recursively. It seems the API docs haven't been updated in a few weeks though, so maybe something else is broken as well.

diff --git a/doc/python_api/ b/doc/python_api/
index 5301f39..c7f0367 100755
--- a/doc/python_api/
+++ b/doc/python_api/
@@ -142,8 +142,11 @@ def main():
     zip_name = "blender_python_reference_%s" % blenver_zip  # We can't use 'release' postfix here...
     zip_path = os.path.join(args.mirror_dir, zip_name)
     with zipfile.ZipFile(zip_path, 'w') as zf:
-        for de in os.scandir(api_dir):
-            zf.write(de.path, arcname=os.path.join(zip_name,
+        for dirname, _, filenames in os.walk(api_dir):
+            for filename in filenames:
+                filepath = os.path.join(dirname, filename)
+                zip_filepath = os.path.join(zip_name, os.path.relpath(filepath, api_dir))
+                zf.write(filepath, arcname=zip_filepath)
     os.rename(zip_path, os.path.join(api_dir, "" % zip_name))

     # VII) Create symlinks and html redirects.

Uh, yeah, kinda stupid mistake from my side here :/

@Brecht Van Lommel (brecht) thanks for the patch, also, doc updating is manual, so only do it once or twice a month currently.