Skip to content

Don't flush file object opened for reading #11636

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

Merged
merged 1 commit into from
Jul 11, 2018

Conversation

gson1703
Copy link

@gson1703 gson1703 commented Jul 11, 2018

Don't attempt to flush a file object opened for reading, because on BSD systems, it results in an error return from fflush(), with the end result that "import matplotlib.pyplot" fails with the error message "TypeError: First argument must be a path or file object reading bytes".

Closes #11635.

…ct opened

for reading, because it returns an error on BSD systems, with the end
result that "import matplotlib.pyplot" fails with the error message
"TypeError: First argument must be a path or file object reading bytes".
@jklymak jklymak added the Release critical For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions. label Jul 11, 2018
@jklymak jklymak added this to the v2.2.3 milestone Jul 11, 2018
@tacaswell tacaswell merged commit c273783 into matplotlib:master Jul 11, 2018
@tacaswell
Copy link
Member

Thanks @gson1703 !

QuLogic added a commit that referenced this pull request Jul 11, 2018
tacaswell added a commit to tacaswell/matplotlib that referenced this pull request Aug 8, 2018
Following up on matplotlib#11635 / matplotlib#11636 another bug was found.

PY3K is always defined in mplutils.h so we were always going through
the nominally (py3 + pypy) only code path on all version of python
which exposes an issue with fflush (eventually called by py27
internals) on BSD systems.
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants