Skip to content

Documentation issues #6527

Closed
Closed
@klonuo

Description

@klonuo

I'm building mpl documentation and wanted to notice these issues:

  1. On Windows os.symlink() requires administrative privileges:
Traceback (most recent call last):
  File "make.py", line 172, in <module>
    os.symlink(target, link)
OSError: symbolic link privilege not held

I'll propose this workaround:

--- a/doc/make.py
+++ b/doc/make.py

@@ -168,9 +178,9 @@ for link, target in required_symlinks:
             raise RuntimeError("doc/{0} should be a directory or symlink -- it"
                                " isn't".format(link))
     if not os.path.exists(link):
-        if hasattr(os, 'symlink'):
+        try:
             os.symlink(target, link)
-        else:
+        except OSError:
             symlink_warnings.append('files copied to {0}'.format(link))
             shutil.copytree(os.path.join(link, '..', target), link)

  1. Documentation's readme says that besides installed matplotlib it is also required matplotlib to be build from source. This seemed unfortunate and I made this workaround to avoid building:
--- a/doc/make.py
+++ b/doc/make.py

@@ -7,6 +7,7 @@ import shutil
 import sys
 import re
 import argparse
+import matplotlib

 def copy_if_out_of_date(original, derived):
     if (not os.path.exists(derived) or
@@ -38,7 +39,11 @@ def linkcheck():

 def html(buildername='html'):
     check_build()
-    copy_if_out_of_date('../lib/matplotlib/mpl-data/matplotlibrc', '_static/matplotlibrc')
+    rc = '../lib/matplotlib/mpl-data/matplotlibrc'
+    active_rc = matplotlib.matplotlib_fname()
+    if not os.path.exists(rc) and os.path.exists(active_rc):
+        rc = active_rc
+    copy_if_out_of_date(rc, '_static/matplotlibrc')
     if small_docs:
         options = "-D plot_formats=png:80"

  1. On finishing, I got this error:
...
generating indices... genindex py-modindex
writing additional pages... index citing gallery
Warning, treated as error:
WARNING: a Unicode error occurred when rendering the page gallery. Please make sure all config values that contain non-ASCII content are Unicode strings.

After quite digging around, I figured that gen_gallery.py is responsible for this error - generated gallery.html ended encoded in my local code page instead UTF-8. I converted gallery file to UTF-8 and disabled writing to this file in gen_gallery.py to be able to make the docs.

I'm not comfortable with trying to fix this, considering both Python versions and OSs, so just to report.


matplotlib-2.0.0b1 on 64-bit Python 3.5.1 on Windows 10

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions