Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Fix inkscape tests #22768

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 2 commits into from
Apr 7, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion 7 lib/matplotlib/testing/compare.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,11 @@ def __call__(self, orig, dest):
weakref.finalize(self._tmpdir, self.__del__)
if (not self._proc # First run.
or self._proc.poll() is not None): # Inkscape terminated.
if self._proc is not None and self._proc.poll() is not None:
for stream in filter(None, [self._proc.stdin,
self._proc.stdout,
self._proc.stderr]):
stream.close()
Copy link
Contributor

@anntzer anntzer Apr 6, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really a problem, but is it really possible for the process' standard streams to still be open even though the process has terminated? (poll() is not None)
Edit for my personal edification: apparently only communicate() and __exit__() close the streams?

env = {
**os.environ,
# If one passes e.g. a png file to Inkscape, it will try to
Expand All @@ -156,7 +161,7 @@ def __call__(self, orig, dest):
# just be reported as a regular exception below).
"DISPLAY": "",
tacaswell marked this conversation as resolved.
Show resolved Hide resolved
# Do not load any user options.
"INKSCAPE_PROFILE_DIR": os.devnull,
"INKSCAPE_PROFILE_DIR": self._tmpdir.name,
}
# Old versions of Inkscape (e.g. 0.48.3.1) seem to sometimes
# deadlock when stderr is redirected to a pipe, so we redirect it
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.