Skip to content

FIX: ioerror font cache, second try #10857

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
wants to merge 513 commits into from

Conversation

jklymak
Copy link
Member

@jklymak jklymak commented Mar 21, 2018

PR Summary

As per #9676 (review) #9676 didn't actually catch the font cache error (well, it caught it, but threw another error instead).

This should fix. @lmr, if you are able to test, that would be very helpful, because I can't actually trigger the error!

PR Checklist

  • Has Pytest style unit tests
  • Code is PEP 8 compliant
  • New features are documented, with examples if plot related
  • Documentation is sphinx and numpydoc compliant
  • Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)
  • Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way

maxnoe and others added 30 commits February 28, 2018 09:07
The `elif` clauses in `Marker.set_marker` needed to be reordered
because any Python object that has a `__len__` method is an
instance of `collections.Sized`.
remove trailing spaces on a comment line
make seaborn great again on Matplotlib-2.2
(Too many spaces between "layout." and "You", missing betwen "subplots"
and "with".)
Fix extra and missing spaces in constrainedlayout warning.
Also reorder other mentioned 3rdparty packages to alphabetical order.
…boilerplate.py

Remove if six.PY2 code paths from boilerplate.py
Support markers from Paths that consist of one line segment
so don't rely on the 3rd party version.

Also replace py.test by pytest in the docs (recommended since pytest
3.0, https://docs.pytest.org/en/latest/changelog.html#id281; we require
pytest>=3.1 anyways).

Also delete tox.ini which is clearly outdated.
Add a link from the examples to the user's guide.

Clarify that the weakref behavior only affects *methods* used as
callbacks, not free functions.
…strainedlayout

FIX/ENH CL: Allow single parent colorbar w/ gridspec layout
Replace the Locked contextmanager (which locks a directory, preventing
other (cooperative) processes to access it) by a private _lock_path
contextmanager, which locks a single file (or directory).

- The finer grained lock avoids locking out the entire tex cache when
  handling usetex, which is useful when running multiple processes at
  once.

- Python3 implements the `"x"` ("exclusive") mode to open, which we can
  use instead of relying on `makedirs` to achieve a race-free operation
  on the filesystem.

- The previous implementation allowed multiple threads of a single
  process to acquire the same lock, but (for the use cases here, e.g.
  running a tex subprocess) this is actually undesirable.  Removing this
  behavior also simplifies the implementation.

- As far as I can tell, the previous implementation was actually racy:
  in

    retries = 50
    sleeptime = 0.1
    while retries:
        files = glob.glob(self.pattern)
        if files and not files[0].endswith(self.end):
            time.sleep(sleeptime)
            retries -= 1
        else:
            break
    else:
        err_str = _lockstr.format(self.pattern)
        raise self.TimeoutError(err_str)

    # <----- HERE

    if not files:
        try:
            os.makedirs(self.lock_path)
        except OSError:
            pass
    else:  # PID lock already here --- someone else will remove it.
        self.remove = False

  multiple processes can reach "HERE" at the same time and each
  successfully create their own lock.
anntzer and others added 18 commits March 17, 2018 21:05
This ensures that when a cairo-based backend is active, animations also
get saved using backend_cairo, rather than falling back on backend_agg.
…string

DOC: make legend docstring interpolated
DOC: Update layout of sidebar in documentation
The Agg backend still doesn't know how to make use of that information
in draw_markers, but third-party backends (e.g. mplcairo) do honor the
setting.
…ture

Make function signatures more explicit
Propagate marker antialias setting to GraphicsContext.
Add some basic smoketesting for webagg (and wx).
- Give the colorbars a reasonable aspect ratio.
- Fix a link.
- Other minor edits.
DOC: Make colorbar tutorial examples look like colorbars.
DOC: Don't use private attribute in tk example.  Fix Toolbar class rename.
@jklymak jklymak added this to the v2.2.3 milestone Mar 21, 2018
@jklymak jklymak added the Release critical For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions. label Mar 21, 2018
@jklymak
Copy link
Member Author

jklymak commented Mar 21, 2018

Note, no need to merge into master because this code no longer exists in master. Hopefully I did the PR correctly to go into 2.2.3

@anntzer
Copy link
Contributor

anntzer commented Mar 21, 2018

The code is still in master (line 912) so the fix should be applied there too.

@anntzer anntzer modified the milestones: v2.2.3, v3.0 Mar 21, 2018
@jklymak jklymak force-pushed the fix-ioerror-font-cache branch from 2d4fb22 to 5766c9f Compare March 21, 2018 17:01
@jklymak jklymak closed this Mar 21, 2018
@jklymak
Copy link
Member Author

jklymak commented Mar 21, 2018

Closed in lieue of #10858 so I could PR against master. Prob a way to do it w/o a new PR, but...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Release critical For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions. status: duplicate
Projects
None yet
Development

Successfully merging this pull request may close these issues.