Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Documentation issues #6527

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
klonuo opened this issue Jun 2, 2016 · 2 comments
Closed

Documentation issues #6527

klonuo opened this issue Jun 2, 2016 · 2 comments

Comments

@klonuo
Copy link
Contributor

klonuo commented Jun 2, 2016

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

@tacaswell
Copy link
Member

Can you please submit both of those changes as a PR?

klonuo added a commit to klonuo/matplotlib that referenced this issue Jun 3, 2016
Referencing matplotlib#6527, these changes provide:

 - fix for symlink exception on Windows
 - no need for rebuilding matplotlib from source
@klonuo klonuo mentioned this issue Jun 3, 2016
@Kojoley Kojoley added this to the 2.0 (style change major release) milestone Nov 10, 2016
@Kojoley
Copy link
Member

Kojoley commented Nov 10, 2016

Closed in #6530

@Kojoley Kojoley closed this as completed Nov 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants