Skip to content

Appveyor build failing #9176

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
dstansby opened this issue Sep 9, 2017 · 37 comments · Fixed by #9395
Closed

Appveyor build failing #9176

dstansby opened this issue Sep 9, 2017 · 37 comments · Fixed by #9395

Comments

@dstansby
Copy link
Member

dstansby commented Sep 9, 2017

The appveyor build is failing fairly consistently on the python 3.5 build (eg. see https://ci.appveyor.com/project/matplotlib/matplotlib/build/1.0.2957/job/dqhano9lykge7ffb#L1375). The actual failure is somewhere in test_artist:

lib\matplotlib\tests\test_artist.py ...ssCommand exited with code -1073740791
@tacaswell tacaswell added this to the 2.1.1 (next bug fix release) milestone Sep 23, 2017
@QuLogic QuLogic mentioned this issue Sep 27, 2017
2 tasks
@tacaswell
Copy link
Member

@kbrose did a bunch of work to speed up the path simplifications in #8776

@dopplershift
Copy link
Contributor

It should be noted, though, that PR passed AppVeyor at the time.

@dopplershift
Copy link
Contributor

There's #9282 that I just opened--at least as far as test_artist.py...-1073740791 is concerned. I went looking back through the AppVeyor logs and noticed that when my jsanimation PR went in is when these started happening. I swear when I saw the first one I looked and checked that the failure wasn't related to my changes (i.e. previous builds on master had the same problem). Apparently I was wrong (my bad).

At any rate while I think I have the failing test identified...I have no idea why it's causing the problem.

@Kojoley
Copy link
Member

Kojoley commented Oct 5, 2017

@cgohlke these exceptions are properly handled (other way python would crash), I do not why, but faulthandler on python 3.6 prints every C++ exception. I have even checked this under debugger + after rewriting convert_rect(py_converters.cpp) to not use exceptions these messages do not show.

@tacaswell
Copy link
Member

Adding '-v' seems to also change the behavior #9229

@kbrose
Copy link
Contributor

kbrose commented Oct 6, 2017

So to clarify, does it look like this is related to the changes I made, or unrelated? If people suspect my modifications may have caused some of the problems I can try to find some time to dig into it.

@Kojoley
Copy link
Member

Kojoley commented Oct 6, 2017

Crash 1

I have some success in reproducing the crash in test_artist.py. It always happens in lib/matplotlib/tests/test_artist.py::test_cull_markers. The smallest set of tests required (for me) to trigger the crash is following:

lib/matplotlib/tests/test_agg.py::test_marker_with_nan PASSED
lib/matplotlib/tests/test_agg.py::test_long_path PASSED
lib/matplotlib/tests/test_animation.py::test_save_animation_smoketest[html-html] PASSED
lib/matplotlib/tests/test_animation.py::test_movie_writer_registry PASSED
lib/matplotlib/tests/test_artist.py::test_cull_markers

And it happens only with specific PYTHONHASHSEED. With 1 2 4 7 8 11 13 15 ... it crashes, while with 3 5 6 9 10 12 14 16 ... does not. Reordering the tests seems to affect something so it does not crash too.

if (fseek(def->fp, offset, SEEK_SET) == -1) {

Stack trace
Name Language Info
ucrtbase.dll!__crt_debugger_hook�() Unknown Non-user code. Symbols loaded.
ucrtbase.dll!__acrt_call_reportfault�() Unknown Non-user code. Symbols loaded.
ucrtbase.dll!_invoke_watson�() Unknown Non-user code. Symbols loaded.
ucrtbase.dll!_invalid_parameter�() Unknown Non-user code. Symbols loaded.
ucrtbase.dll!_invalid_parameter_noinfo�() Unknown Non-user code. Symbols loaded.
ucrtbase.dll!_get_osfhandle�() Unknown Non-user code. Symbols loaded.
ucrtbase.dll!_locking�() Unknown Non-user code. Symbols loaded.
ucrtbase.dll!freopen_s�() Unknown Non-user code. Symbols loaded.
ucrtbase.dll!freopen_s�() Unknown Non-user code. Symbols loaded.
ucrtbase.dll!freopen_s�() Unknown Non-user code. Symbols loaded.
» ft2font.cp35-win_amd64.pyd!read_from_file_callback(FT_StreamRec_ * stream, unsigned long offset, unsigned char * buffer, unsigned long count) Line 349 C++ Symbols loaded.
[External Code] Annotated Frame
ft2font.cp35-win_amd64.pyd!FT2Font::set_text(unsigned __int64 N, unsigned int * codepoints, double angle, int flags, std::vector<double,std::allocator > & xys) Line 625 C++ Symbols loaded.
ft2font.cp35-win_amd64.pyd!PyFT2Font_set_text(PyFT2Font * self, _object * args, _object * kwds) Line 686 C++ Symbols loaded.
[External Code] Annotated Frame
backend_pdf.py!get_text_width_height_descent Line 2173 Python Symbols loaded.
text.py!_get_layout Line 354 Python Symbols loaded.
text.py!get_window_extent Line 970 Python Symbols loaded.
axis.py!_get_tick_bboxes Line 1055 Python Symbols loaded.
axis.py!draw Line 1115 Python Symbols loaded.
artist.py!draw_wrapper Line 55 Python Symbols loaded.
image.py!_draw_list_compositing_images Line 138 Python Symbols loaded.
_base.py!draw Line 2401 Python Symbols loaded.
artist.py!draw_wrapper Line 55 Python Symbols loaded.
image.py!_draw_list_compositing_images Line 138 Python Symbols loaded.
figure.py!draw Line 1294 Python Symbols loaded.
artist.py!draw_wrapper Line 55 Python Symbols loaded.
backend_pdf.py!print_pdf Line 2592 Python Symbols loaded.
backend_bases.py!print_figure Line 2258 Python Symbols loaded.
figure.py!savefig Line 1813 Python Symbols loaded.
test_artist.py!test_cull_markers Line 143 Python Symbols loaded.
python.py!pytest_pyfunc_call Line 143 Python Symbols loaded.
pluggy.py!execute Line 614 Python Symbols loaded.
pluggy.py!init Line 265 Python Symbols loaded.
pluggy.py!_wrapped_call Line 248 Python Symbols loaded.
pluggy.py!execute Line 613 Python Symbols loaded.
pluggy.py! Line 334 Python Symbols loaded.
pluggy.py!_hookexec Line 339 Python Symbols loaded.
pluggy.py!call Line 745 Python Symbols loaded.
python.py!runtest Line 1171 Python Symbols loaded.
runner.py!pytest_runtest_call Line 112 Python Symbols loaded.
pluggy.py!execute Line 614 Python Symbols loaded.
pluggy.py!init Line 265 Python Symbols loaded.
pluggy.py!_wrapped_call Line 248 Python Symbols loaded.
pluggy.py!execute Line 613 Python Symbols loaded.
pluggy.py!init Line 265 Python Symbols loaded.
pluggy.py!_wrapped_call Line 248 Python Symbols loaded.
pluggy.py!execute Line 613 Python Symbols loaded.
pluggy.py! Line 334 Python Symbols loaded.
pluggy.py!_hookexec Line 339 Python Symbols loaded.
pluggy.py!call Line 745 Python Symbols loaded.
runner.py! Line 182 Python Symbols loaded.
runner.py!init Line 196 Python Symbols loaded.
runner.py!call_runtest_hook Line 182 Python Symbols loaded.
runner.py!call_and_report Line 162 Python Symbols loaded.
runner.py!runtestprotocol Line 82 Python Symbols loaded.
runner.py!pytest_runtest_protocol Line 68 Python Symbols loaded.
pluggy.py!execute Line 614 Python Symbols loaded.
pluggy.py!init Line 265 Python Symbols loaded.
pluggy.py!_wrapped_call Line 248 Python Symbols loaded.
pluggy.py!execute Line 613 Python Symbols loaded.
pluggy.py!init Line 265 Python Symbols loaded.
pluggy.py!_wrapped_call Line 248 Python Symbols loaded.
pluggy.py!execute Line 613 Python Symbols loaded.
pluggy.py!init Line 265 Python Symbols loaded.
pluggy.py!_wrapped_call Line 248 Python Symbols loaded.
pluggy.py!execute Line 613 Python Symbols loaded.
pluggy.py! Line 334 Python Symbols loaded.
pluggy.py!_hookexec Line 339 Python Symbols loaded.
pluggy.py!call Line 745 Python Symbols loaded.
main.py!pytest_runtestloop Line 169 Python Symbols loaded.
pluggy.py!execute Line 598 Python Symbols loaded.
pluggy.py! Line 333 Python Symbols loaded.
pluggy.py!_hookexec Line 336 Python Symbols loaded.
pluggy.py!call Line 743 Python Symbols loaded.
main.py!_main Line 142 Python Symbols loaded.
main.py!wrap_session Line 99 Python Symbols loaded.
main.py!pytest_cmdline_main Line 138 Python Symbols loaded.
pluggy.py!execute Line 598 Python Symbols loaded.
pluggy.py! Line 333 Python Symbols loaded.
pluggy.py!_hookexec Line 336 Python Symbols loaded.
pluggy.py!call Line 743 Python Symbols loaded.
config.py!main Line 39 Python Symbols loaded.
init.py!test Line 1388 Python Symbols loaded.
tests.py! Line 11 Python Symbols loaded.

Crash 2

This crash happened to me several times upon stopping pytest with Ctrl+C

fclose(handle);

if (mpl_PyFile_DupClose(def->py_file, def->fp, def->offset)) {

Stack trace
Name Language Info
ucrtbase.dll!_invoke_watson�() Unknown Non-user code. Symbols loaded.
ucrtbase.dll!_invalid_parameter�() Unknown Non-user code. Symbols loaded.
ucrtbase.dll!_invalid_parameter_noinfo�() Unknown Non-user code. Symbols loaded.
ucrtbase.dll!_locking�() Unknown Non-user code. Symbols loaded.
ucrtbase.dll!fsetpos�() Unknown Non-user code. Symbols loaded.
ucrtbase.dll!fsetpos�() Unknown Non-user code. Symbols loaded.
» ft2font.cp35-win_amd64.pyd!mpl_PyFile_DupClose(_object * file, _iobuf * handle, __int64 orig_pos) Line 136 C++ Symbols loaded.
ft2font.cp35-win_amd64.pyd!close_file_callback(FT_StreamRec_ * stream) Line 364 C++ Symbols loaded.
[External Code] Annotated Frame
ft2font.cp35-win_amd64.pyd!FT2Font::~FT2Font() Line 530 C++ Symbols loaded.
[External Code] Annotated Frame
ft2font.cp35-win_amd64.pyd!PyFT2Font_dealloc(PyFT2Font * self) Line 541 C++ Symbols loaded.
python35.dll!lru_list_elem_dealloc(lru_list_elem * link) Line 633 C Symbols loaded.
[Inline Frame] python35.dll!lru_cache_clear_list(lru_list_elem * link) Line 1034 C Symbols loaded.
python35.dll!lru_cache_tp_clear(lru_cache_object * self) Line 1133 C Symbols loaded.
python35.dll!delete_garbage(_gc_head * collectable, _gc_head * old) Line 867 C Symbols loaded.
python35.dll!collect(int generation, __int64 * n_collected, __int64 * n_uncollectable, int nofail) Line 1019 C Symbols loaded.
[Inline Frame] python35.dll!_PyGC_CollectNoFail() Line 1605 C Symbols loaded.
python35.dll!PyImport_Cleanup() Line 481 C Symbols loaded.
python35.dll!Py_Finalize() Line 579 C Symbols loaded.
[Inline Frame] python35.dll!Py_Exit(int) Line 1474 C Symbols loaded.
python35.dll!handle_system_exit() Line 617 C Symbols loaded.
python35.dll!PyErr_PrintEx(int set_sys_last_vars) Line 629 C Symbols loaded.
[Inline Frame] python35.dll!PyErr_Print() Line 523 C Symbols loaded.
python35.dll!PyRun_SimpleFileExFlags(_iobuf * fp, const char * filename, int closeit, PyCompilerFlags * flags) Line 417 C Symbols loaded.
python35.dll!PyRun_AnyFileExFlags(_iobuf * fp, const char * filename, int closeit, PyCompilerFlags * flags) Line 81 C Symbols loaded.
python35.dll!run_file(_iobuf * fp, const wchar_t * filename, PyCompilerFlags * p_cf) Line 328 C Symbols loaded.
python35.dll!Py_Main(int argc, wchar_t * * argv) Line 778 C Symbols loaded.
[External Code] Annotated Frame

@cgohlke
Copy link
Contributor

cgohlke commented Oct 6, 2017

@Kojoley are your builds using Appveyor or freetype built with setup_external_compile.py?

In that case, crashes are not really unexpected. See comments at #6969 (diff)

@Kojoley
Copy link
Member

Kojoley commented Oct 6, 2017

@cgohlke I cannot catch what are you saying. Freetype builds successfully by setup_external_compile all the time for me with every python version I had tried (2.7, 3.4, 3.5, 3.6).

@cgohlke
Copy link
Contributor

cgohlke commented Oct 6, 2017

When using setup_external_compile on Python 3.5 and 3.6, freetype is built with the Visual Studio 2010 compiler, which uses a different C runtime than Python and the rest of the matplotlib C extensions, which are built with Visual Studio 2015. This can cause strange crashes.

@Kojoley
Copy link
Member

Kojoley commented Oct 6, 2017

You are right about different runtimes and it might be a root cause if ft2font would not be a mpl python extension that builds with setuptools. It should not be hard to build freetype with VS2017 (using cmake or convert/upgrade project) so I will check this.

@cgohlke
Copy link
Contributor

cgohlke commented Oct 6, 2017

Yes, the ft2font Python extension is built with VS2015, but the freetype library is built with VS2010 and linked into the ft2font extension.

@Kojoley
Copy link
Member

Kojoley commented Oct 6, 2017

No, not VS2015 (I do not even have it), look here https://wiki.python.org/moin/WindowsCompilers

Update: Actually it does not matter, VS2015 and VS2017 provides same compiler version of 14.0

@Kojoley
Copy link
Member

Kojoley commented Oct 7, 2017

It was really not worth it, but...
I have built zlib, libpng, freetype with 2015 Build Tools (Microsoft (R) Build Engine version 14.0.25420.1), and nothing changed in terms of a crash.

Today it does not crash, but at the end I got The program '[1260] python.exe' has exited with code -1073740777 (0xc0000417)..

@cgohlke
Copy link
Contributor

cgohlke commented Oct 7, 2017

nothing changed in terms of a crash.
Today it does not crash

Are the file pointer related crashes gone or not when using 2015 Build Tools?

@Kojoley
Copy link
Member

Kojoley commented Oct 8, 2017

The python exits with error code -1073740777 but does not actually crashes.
5 minutes ago I have tried with python from python.org (2015 Build Tools build) it crashed with -1073740777 here

if (mpl_lseek(fd, orig_pos, SEEK_SET) != -1) {

@Kojoley
Copy link
Member

Kojoley commented Oct 8, 2017

I still can't reproduce any crash or exit errors, even with VS2010 builds of freetype and PYTHONHASHSEED set to 1 or 2.

I do it that way:

@set /a x=0
:begin
@set /a x+=1
set PYTHONHASHSEED=%x%
python tests.py -v lib/matplotlib/tests/test_agg.py lib\matplotlib\tests\test_animation.py lib\matplotlib\tests\test_artist.py
goto begin

You might want to build with debug symbols

I already do it, otherwise I could not get a crash line, only disassembled code mess.

I wanted to try to build with debug python, have downloaded it but it crashes on python_d.exe -m pip install --no-deps -ve . at this line

>python_d.exe -m pip install --no-deps -ve .
Config variable 'Py_DEBUG' is unset, Python ABI tag may be incorrect
Config variable 'WITH_PYMALLOC' is unset, Python ABI tag may be incorrect
Obtaining file:///C:/Temp/matplotlib
  Running setup.py (path:C:\Temp\matplotlib\setup.py) egg_info for package from file:///C:/Temp/matplotlib
    Running command python setup.py egg_info
>>> CRASH <<<
Cleaning up...
Command "python setup.py egg_info" failed with error code 2147483651 in C:\Temp\matplotlib\
Exception information:
Traceback (most recent call last):
  File "...\Python35\lib\site-packages\pip\basecommand.py", line 215, in main
    status = self.run(options, args)
  File "...\Python35\lib\site-packages\pip\commands\install.py", line 335, in run
    wb.build(autobuilding=True)
  File "...\Python35\lib\site-packages\pip\wheel.py", line 749, in build
    self.requirement_set.prepare_files(self.finder)
  File "...\Python35\lib\site-packages\pip\req\req_set.py", line 380, in prepare_files
    ignore_dependencies=self.ignore_dependencies))
  File "...\Python35\lib\site-packages\pip\req\req_set.py", line 518, in _prepare_file
    abstract_dist.prep_for_dist()
  File "...\Python35\lib\site-packages\pip\req\req_set.py", line 129, in prep_for_dist
    self.req_to_install.run_egg_info()
  File "...\Python35\lib\site-packages\pip\req\req_install.py", line 439, in run_egg_info
    command_desc='python setup.py egg_info')
  File "...\Python35\lib\site-packages\pip\utils\__init__.py", line 707, in call_subprocess
    % (command_desc, proc.returncode, cwd))
pip.exceptions.InstallationError: Command "python setup.py egg_info" failed with error code 2147483651 in C:\Temp\matplotlib\
...\Python35\lib\site-packages\pip\basecommand.py:229: ResourceWarning: unclosed file <_io.BufferedReader name=3>
  return ERROR

image

Stack trace
Name Language Info
ucrtbased.dll!_close(int fh) Line 48 C++ Non-user code. Symbols loaded.
» python35_d.dll!os_close_impl(_object * module, int fd) Line 7812 C Symbols loaded.
python35_d.dll!os_close(_object * module, _object * args, _object * kwargs) Line 3240 C Symbols loaded.
python35_d.dll!PyCFunction_Call(_object * func, _object * args, _object * kwds) Line 98 C Symbols loaded.
python35_d.dll!call_function(_object * * * pp_stack, int oparg) Line 4758 C Symbols loaded.
python35_d.dll!PyEval_EvalFrameEx(_frame * f, int throwflag) Line 3291 C Symbols loaded.
python35_d.dll!_PyEval_EvalCodeWithName(_object * _co, _object * globals, _object * locals, _object * * args, int argcount, _object * * kws, int kwcount, _object * * defs, int defcount, _object * kwdefs, _object * closure, _object * name, _object * qualname) Line 4071 C Symbols loaded.
python35_d.dll!PyEval_EvalCodeEx(_object * _co, _object * globals, _object * locals, _object * * args, int argcount, _object * * kws, int kwcount, _object * * defs, int defcount, _object * kwdefs, _object * closure) Line 4096 C Symbols loaded.
python35_d.dll!function_call(_object * func, _object * arg, _object * kw) Line 627 C Symbols loaded.
python35_d.dll!PyObject_Call(_object * func, _object * arg, _object * kw) Line 2166 C Symbols loaded.
python35_d.dll!method_call(_object * func, _object * arg, _object * kw) Line 330 C Symbols loaded.
python35_d.dll!PyObject_Call(_object * func, _object * arg, _object * kw) Line 2166 C Symbols loaded.
python35_d.dll!slot_tp_init(_object * self, _object * args, _object * kwds) Line 6314 C Symbols loaded.
python35_d.dll!type_call(_typeobject * type, _object * args, _object * kwds) Line 905 C Symbols loaded.
python35_d.dll!PyObject_Call(_object * func, _object * arg, _object * kw) Line 2166 C Symbols loaded.
python35_d.dll!do_call(_object * func, _object * * * pp_stack, int na, int nk) Line 4989 C Symbols loaded.
python35_d.dll!call_function(_object * * * pp_stack, int oparg) Line 4787 C Symbols loaded.
python35_d.dll!PyEval_EvalFrameEx(_frame * f, int throwflag) Line 3291 C Symbols loaded.
python35_d.dll!_PyEval_EvalCodeWithName(_object * _co, _object * globals, _object * locals, _object * * args, int argcount, _object * * kws, int kwcount, _object * * defs, int defcount, _object * kwdefs, _object * closure, _object * name, _object * qualname) Line 4071 C Symbols loaded.
python35_d.dll!fast_function(_object * func, _object * * * pp_stack, int n, int na, int nk) Line 4871 C Symbols loaded.
python35_d.dll!call_function(_object * * * pp_stack, int oparg) Line 4783 C Symbols loaded.
python35_d.dll!PyEval_EvalFrameEx(_frame * f, int throwflag) Line 3291 C Symbols loaded.
python35_d.dll!_PyEval_EvalCodeWithName(_object * _co, _object * globals, _object * locals, _object * * args, int argcount, _object * * kws, int kwcount, _object * * defs, int defcount, _object * kwdefs, _object * closure, _object * name, _object * qualname) Line 4071 C Symbols loaded.
python35_d.dll!fast_function(_object * func, _object * * * pp_stack, int n, int na, int nk) Line 4871 C Symbols loaded.
python35_d.dll!call_function(_object * * * pp_stack, int oparg) Line 4783 C Symbols loaded.
python35_d.dll!PyEval_EvalFrameEx(_frame * f, int throwflag) Line 3291 C Symbols loaded.
python35_d.dll!_PyEval_EvalCodeWithName(_object * _co, _object * globals, _object * locals, _object * * args, int argcount, _object * * kws, int kwcount, _object * * defs, int defcount, _object * kwdefs, _object * closure, _object * name, _object * qualname) Line 4071 C Symbols loaded.
python35_d.dll!fast_function(_object * func, _object * * * pp_stack, int n, int na, int nk) Line 4871 C Symbols loaded.
python35_d.dll!call_function(_object * * * pp_stack, int oparg) Line 4783 C Symbols loaded.
python35_d.dll!PyEval_EvalFrameEx(_frame * f, int throwflag) Line 3291 C Symbols loaded.
python35_d.dll!fast_function(_object * func, _object * * * pp_stack, int n, int na, int nk) Line 4857 C Symbols loaded.
python35_d.dll!call_function(_object * * * pp_stack, int oparg) Line 4783 C Symbols loaded.
python35_d.dll!PyEval_EvalFrameEx(_frame * f, int throwflag) Line 3291 C Symbols loaded.
python35_d.dll!_PyEval_EvalCodeWithName(_object * _co, _object * globals, _object * locals, _object * * args, int argcount, _object * * kws, int kwcount, _object * * defs, int defcount, _object * kwdefs, _object * closure, _object * name, _object * qualname) Line 4071 C Symbols loaded.
python35_d.dll!PyEval_EvalCodeEx(_object * _co, _object * globals, _object * locals, _object * * args, int argcount, _object * * kws, int kwcount, _object * * defs, int defcount, _object * kwdefs, _object * closure) Line 4096 C Symbols loaded.
python35_d.dll!PyEval_EvalCode(_object * co, _object * globals, _object * locals) Line 783 C Symbols loaded.
python35_d.dll!builtin_exec_impl(_object * module, _object * source, _object * globals, _object * locals) Line 956 C Symbols loaded.
python35_d.dll!builtin_exec(_object * module, _object * args) Line 274 C Symbols loaded.
python35_d.dll!PyCFunction_Call(_object * func, _object * args, _object * kwds) Line 109 C Symbols loaded.
python35_d.dll!call_function(_object * * * pp_stack, int oparg) Line 4758 C Symbols loaded.
python35_d.dll!PyEval_EvalFrameEx(_frame * f, int throwflag) Line 3291 C Symbols loaded.
python35_d.dll!_PyEval_EvalCodeWithName(_object * _co, _object * globals, _object * locals, _object * * args, int argcount, _object * * kws, int kwcount, _object * * defs, int defcount, _object * kwdefs, _object * closure, _object * name, _object * qualname) Line 4071 C Symbols loaded.
python35_d.dll!PyEval_EvalCodeEx(_object * _co, _object * globals, _object * locals, _object * * args, int argcount, _object * * kws, int kwcount, _object * * defs, int defcount, _object * kwdefs, _object * closure) Line 4096 C Symbols loaded.
python35_d.dll!PyEval_EvalCode(_object * co, _object * globals, _object * locals) Line 783 C Symbols loaded.
python35_d.dll!run_mod(_mod * mod, _object * filename, _object * globals, _object * locals, PyCompilerFlags * flags, _arena * arena) Line 991 C Symbols loaded.
python35_d.dll!PyRun_StringFlags(const char * str, int start, _object * globals, _object * locals, PyCompilerFlags * flags) Line 915 C Symbols loaded.
python35_d.dll!PyRun_SimpleStringFlags(const char * command, PyCompilerFlags * flags) Line 436 C Symbols loaded.
python35_d.dll!run_command(wchar_t * command, PyCompilerFlags * cf) Line 289 C Symbols loaded.
python35_d.dll!Py_Main(int argc, wchar_t * * argv) Line 716 C Symbols loaded.
python_d.exe!wmain(int argc, wchar_t * * argv) Line 15 C Symbols loaded.
[External Code] Annotated Frame

Now I suspect that something wrong with python itself or I just do not understand what happens at all.

@tacaswell
Copy link
Member

Thanks for both of your work on this!

Is it time to escalate to the cpython folks?

@Kojoley
Copy link
Member

Kojoley commented Oct 8, 2017

only sporadically

Using a constant PYTHONHASHSEED ?

I'm not set up to debug in the VM

You can use remote debug or download a crash dump to host and load it in a debugger.

Is it time to escalate to the cpython folks?

I think at least one thing we can do before escalating this to cpython devs is to check for different python versions.

@cgohlke
Copy link
Contributor

cgohlke commented Oct 9, 2017

I now can reproduce a crash and stack trace on Python 3.4.4, 64-bit, Windows 7. Basically the same as Crash 2 reported earlier. I noticed that the mpl_PyFile_Dup and mpl_PyFile_DupClose functions in file_compat.h are outdated wrt to the numpy equivalents and should probably be updated. Not sure if that will fix the crash...

@Kojoley
Copy link
Member

Kojoley commented Oct 10, 2017

  • 3.5.2, 3.5.4 - crash upon exit (cannot reproduce crash on test_artists anymore, I do not know what has changed)
  • 3.6.2 no crash, but test fails with [Errno 9] Bad file descriptor
Output log
(pyenv36) C:\Working\Repositories\matplotlib>set PYTHONHASHSEED=1

(pyenv36) C:\Working\Repositories\matplotlib>python tests.py lib/matplotlib/tests/test_agg.py lib\matplotlib\tests\test_animation.py lib\matplotlib\tests\test_artist.py
Python byte-compilation optimization level: 0
============================= test session starts =============================
platform win32 -- Python 3.6.2, pytest-3.2.3, py-1.4.34, pluggy-0.4.0
rootdir: C:\Working\Repositories\matplotlib, inifile: pytest.ini
plugins: xdist-1.20.0, timeout-1.2.0, rerunfailures-3.1, pycharm-0.4.0, forked-0.2, cov-2.5.1
collected 35 items

lib\matplotlib\tests\test_agg.py ........
lib\matplotlib\tests\test_animation.py ..ssssssss.FEEEEE
lib\matplotlib\tests\test_artist.py EEEEEEEEEEEEEEEEEEEEEEEEEE

=================================== ERRORS ====================================
________ ERROR at teardown of test_save_animation_smoketest[null-null] ________

self = <CallInfo when='teardown' exception: [Errno 9] Bad file descriptor>
func = <function call_runtest_hook.<locals>.<lambda> at 0x0000000005A06620>
when = 'teardown'

    def __init__(self, func, when):
        #: context of invocation: one of "setup", "call",
        #: "teardown", "memocollect"
        self.when = when
        self.start = time()
        try:
>           self.result = func()

C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\runner.py:196:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\runner.py:182: in <lambda>
    return CallInfo(lambda: ihook(item=item, **kwds), when=when)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:745: in __call__
    return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:339: in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:334: in <lambda>
    _MultiCall(methods, kwargs, hook.spec_opts).execute()
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:613: in execute
    return _wrapped_call(hook_impl.function(*args), self.execute)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:245: in _wrapped_call
    next(wrap_controller)   # first yield
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:143: in pytest_runtest_teardown
    self.resumecapture()
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:90: in resumecapture
    self._capturing.resume_capturing()
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:307: in resume_capturing
    self.err.resume()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <FDCapture 2 oldfd=9>

    def resume(self):
        self.syscapture.resume()
>       os.dup2(self.tmpfile_fd, self.targetfd)
E       OSError: [Errno 9] Bad file descriptor

C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:401: OSError
___________________ ERROR at setup of test_no_length_frames ___________________

self = <CallInfo when='setup' exception: [Errno 9] Bad file descriptor>
func = <function call_runtest_hook.<locals>.<lambda> at 0x0000000005A06840>
when = 'setup'

    def __init__(self, func, when):
        #: context of invocation: one of "setup", "call",
        #: "teardown", "memocollect"
        self.when = when
        self.start = time()
        try:
>           self.result = func()

C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\runner.py:196:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\runner.py:182: in <lambda>
    return CallInfo(lambda: ihook(item=item, **kwds), when=when)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:745: in __call__
    return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:339: in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:334: in <lambda>
    _MultiCall(methods, kwargs, hook.spec_opts).execute()
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:613: in execute
    return _wrapped_call(hook_impl.function(*args), self.execute)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:245: in _wrapped_call
    next(wrap_controller)   # first yield
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:129: in pytest_runtest_setup
    self.resumecapture()
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:90: in resumecapture
    self._capturing.resume_capturing()
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:307: in resume_capturing
    self.err.resume()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <FDCapture 2 oldfd=9>

    def resume(self):
        self.syscapture.resume()
>       os.dup2(self.tmpfile_fd, self.targetfd)
E       OSError: [Errno 9] Bad file descriptor

C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:401: OSError
_________________ ERROR at teardown of test_no_length_frames __________________

self = <CallInfo when='teardown' exception: [Errno 9] Bad file descriptor>
func = <function call_runtest_hook.<locals>.<lambda> at 0x000000000501A598>
when = 'teardown'

    def __init__(self, func, when):
        #: context of invocation: one of "setup", "call",
        #: "teardown", "memocollect"
        self.when = when
        self.start = time()
        try:
>           self.result = func()

C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\runner.py:196:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\runner.py:182: in <lambda>
    return CallInfo(lambda: ihook(item=item, **kwds), when=when)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:745: in __call__
    return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:339: in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:334: in <lambda>
    _MultiCall(methods, kwargs, hook.spec_opts).execute()
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:613: in execute
    return _wrapped_call(hook_impl.function(*args), self.execute)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:245: in _wrapped_call
    next(wrap_controller)   # first yield
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:143: in pytest_runtest_teardown
    self.resumecapture()
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:90: in resumecapture
    self._capturing.resume_capturing()
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:307: in resume_capturing
    self.err.resume()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <FDCapture 2 oldfd=9>

    def resume(self):
        self.syscapture.resume()
>       os.dup2(self.tmpfile_fd, self.targetfd)
E       OSError: [Errno 9] Bad file descriptor

C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:401: OSError
________________ ERROR at setup of test_movie_writer_registry _________________

self = <CallInfo when='setup' exception: [Errno 9] Bad file descriptor>
func = <function call_runtest_hook.<locals>.<lambda> at 0x000000000501AC80>
when = 'setup'

    def __init__(self, func, when):
        #: context of invocation: one of "setup", "call",
        #: "teardown", "memocollect"
        self.when = when
        self.start = time()
        try:
>           self.result = func()

C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\runner.py:196:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\runner.py:182: in <lambda>
    return CallInfo(lambda: ihook(item=item, **kwds), when=when)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:745: in __call__
    return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:339: in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:334: in <lambda>
    _MultiCall(methods, kwargs, hook.spec_opts).execute()
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:613: in execute
    return _wrapped_call(hook_impl.function(*args), self.execute)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:245: in _wrapped_call
    next(wrap_controller)   # first yield
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:129: in pytest_runtest_setup
    self.resumecapture()
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:90: in resumecapture
    self._capturing.resume_capturing()
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:307: in resume_capturing
    self.err.resume()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <FDCapture 2 oldfd=9>

    def resume(self):
        self.syscapture.resume()
>       os.dup2(self.tmpfile_fd, self.targetfd)
E       OSError: [Errno 9] Bad file descriptor

C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:401: OSError
_______________ ERROR at teardown of test_movie_writer_registry _______________

self = <CallInfo when='teardown' exception: [Errno 9] Bad file descriptor>
func = <function call_runtest_hook.<locals>.<lambda> at 0x000000000501A9D8>
when = 'teardown'

    def __init__(self, func, when):
        #: context of invocation: one of "setup", "call",
        #: "teardown", "memocollect"
        self.when = when
        self.start = time()
        try:
>           self.result = func()

C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\runner.py:196:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\runner.py:182: in <lambda>
    return CallInfo(lambda: ihook(item=item, **kwds), when=when)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:745: in __call__
    return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:339: in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:334: in <lambda>
    _MultiCall(methods, kwargs, hook.spec_opts).execute()
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:613: in execute
    return _wrapped_call(hook_impl.function(*args), self.execute)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:245: in _wrapped_call
    next(wrap_controller)   # first yield
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:143: in pytest_runtest_teardown
    self.resumecapture()
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:90: in resumecapture
    self._capturing.resume_capturing()
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:307: in resume_capturing
    self.err.resume()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <FDCapture 2 oldfd=9>

    def resume(self):
        self.syscapture.resume()
>       os.dup2(self.tmpfile_fd, self.targetfd)
E       OSError: [Errno 9] Bad file descriptor

C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:401: OSError
_______________ ERROR at setup of test_patch_transform_of_none ________________

self = <CallInfo when='setup' exception: [Errno 9] Bad file descriptor>
func = <function call_runtest_hook.<locals>.<lambda> at 0x0000000005A1EF28>
when = 'setup'

    def __init__(self, func, when):
        #: context of invocation: one of "setup", "call",
        #: "teardown", "memocollect"
        self.when = when
        self.start = time()
        try:
>           self.result = func()

C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\runner.py:196:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\runner.py:182: in <lambda>
    return CallInfo(lambda: ihook(item=item, **kwds), when=when)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:745: in __call__
    return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:339: in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:334: in <lambda>
    _MultiCall(methods, kwargs, hook.spec_opts).execute()
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:613: in execute
    return _wrapped_call(hook_impl.function(*args), self.execute)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:245: in _wrapped_call
    next(wrap_controller)   # first yield
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:129: in pytest_runtest_setup
    self.resumecapture()
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:90: in resumecapture
    self._capturing.resume_capturing()
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:307: in resume_capturing
    self.err.resume()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <FDCapture 2 oldfd=9>

    def resume(self):
        self.syscapture.resume()
>       os.dup2(self.tmpfile_fd, self.targetfd)
E       OSError: [Errno 9] Bad file descriptor

C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:401: OSError
______________ ERROR at teardown of test_patch_transform_of_none ______________

self = <CallInfo when='teardown' exception: [Errno 9] Bad file descriptor>
func = <function call_runtest_hook.<locals>.<lambda> at 0x0000000016056268>
when = 'teardown'

    def __init__(self, func, when):
        #: context of invocation: one of "setup", "call",
        #: "teardown", "memocollect"
        self.when = when
        self.start = time()
        try:
>           self.result = func()

C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\runner.py:196:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\runner.py:182: in <lambda>
    return CallInfo(lambda: ihook(item=item, **kwds), when=when)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:745: in __call__
    return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:339: in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:334: in <lambda>
    _MultiCall(methods, kwargs, hook.spec_opts).execute()
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:613: in execute
    return _wrapped_call(hook_impl.function(*args), self.execute)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:245: in _wrapped_call
    next(wrap_controller)   # first yield
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:143: in pytest_runtest_teardown
    self.resumecapture()
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:90: in resumecapture
    self._capturing.resume_capturing()
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:307: in resume_capturing
    self.err.resume()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <FDCapture 2 oldfd=9>

    def resume(self):
        self.syscapture.resume()
>       os.dup2(self.tmpfile_fd, self.targetfd)
E       OSError: [Errno 9] Bad file descriptor

C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:401: OSError
_____________ ERROR at setup of test_collection_transform_of_none _____________

self = <CallInfo when='setup' exception: [Errno 9] Bad file descriptor>
func = <function call_runtest_hook.<locals>.<lambda> at 0x000000000501A730>
when = 'setup'

    def __init__(self, func, when):
        #: context of invocation: one of "setup", "call",
        #: "teardown", "memocollect"
        self.when = when
        self.start = time()
        try:
>           self.result = func()

C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\runner.py:196:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\runner.py:182: in <lambda>
    return CallInfo(lambda: ihook(item=item, **kwds), when=when)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:745: in __call__
    return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:339: in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:334: in <lambda>
    _MultiCall(methods, kwargs, hook.spec_opts).execute()
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:613: in execute
    return _wrapped_call(hook_impl.function(*args), self.execute)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:245: in _wrapped_call
    next(wrap_controller)   # first yield
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:129: in pytest_runtest_setup
    self.resumecapture()
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:90: in resumecapture
    self._capturing.resume_capturing()
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:307: in resume_capturing
    self.err.resume()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <FDCapture 2 oldfd=9>

    def resume(self):
        self.syscapture.resume()
>       os.dup2(self.tmpfile_fd, self.targetfd)
E       OSError: [Errno 9] Bad file descriptor

C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:401: OSError
___________ ERROR at teardown of test_collection_transform_of_none ____________

self = <CallInfo when='teardown' exception: [Errno 9] Bad file descriptor>
func = <function call_runtest_hook.<locals>.<lambda> at 0x000000000501AC80>
when = 'teardown'

    def __init__(self, func, when):
        #: context of invocation: one of "setup", "call",
        #: "teardown", "memocollect"
        self.when = when
        self.start = time()
        try:
>           self.result = func()

C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\runner.py:196:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\runner.py:182: in <lambda>
    return CallInfo(lambda: ihook(item=item, **kwds), when=when)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:745: in __call__
    return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:339: in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:334: in <lambda>
    _MultiCall(methods, kwargs, hook.spec_opts).execute()
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:613: in execute
    return _wrapped_call(hook_impl.function(*args), self.execute)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:245: in _wrapped_call
    next(wrap_controller)   # first yield
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:143: in pytest_runtest_teardown
    self.resumecapture()
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:90: in resumecapture
    self._capturing.resume_capturing()
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:307: in resume_capturing
    self.err.resume()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <FDCapture 2 oldfd=9>

    def resume(self):
        self.syscapture.resume()
>       os.dup2(self.tmpfile_fd, self.targetfd)
E       OSError: [Errno 9] Bad file descriptor

C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:401: OSError
____________________ ERROR at setup of test_clipping[png] _____________________

self = <CallInfo when='setup' exception: [Errno 9] Bad file descriptor>
func = <function call_runtest_hook.<locals>.<lambda> at 0x000000000501B400>
when = 'setup'

    def __init__(self, func, when):
        #: context of invocation: one of "setup", "call",
        #: "teardown", "memocollect"
        self.when = when
        self.start = time()
        try:
>           self.result = func()

C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\runner.py:196:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\runner.py:182: in <lambda>
    return CallInfo(lambda: ihook(item=item, **kwds), when=when)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:745: in __call__
    return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:339: in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:334: in <lambda>
    _MultiCall(methods, kwargs, hook.spec_opts).execute()
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:613: in execute
    return _wrapped_call(hook_impl.function(*args), self.execute)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:245: in _wrapped_call
    next(wrap_controller)   # first yield
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:129: in pytest_runtest_setup
    self.resumecapture()
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:90: in resumecapture
    self._capturing.resume_capturing()
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:307: in resume_capturing
    self.err.resume()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <FDCapture 2 oldfd=9>

    def resume(self):
        self.syscapture.resume()
>       os.dup2(self.tmpfile_fd, self.targetfd)
E       OSError: [Errno 9] Bad file descriptor

C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:401: OSError
___________________ ERROR at teardown of test_clipping[png] ___________________

self = <CallInfo when='teardown' exception: [Errno 9] Bad file descriptor>
func = <function call_runtest_hook.<locals>.<lambda> at 0x000000000501BAE8>
when = 'teardown'

    def __init__(self, func, when):
        #: context of invocation: one of "setup", "call",
        #: "teardown", "memocollect"
        self.when = when
        self.start = time()
        try:
>           self.result = func()

C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\runner.py:196:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\runner.py:182: in <lambda>
    return CallInfo(lambda: ihook(item=item, **kwds), when=when)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:745: in __call__
    return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:339: in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:334: in <lambda>
    _MultiCall(methods, kwargs, hook.spec_opts).execute()
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:613: in execute
    return _wrapped_call(hook_impl.function(*args), self.execute)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:245: in _wrapped_call
    next(wrap_controller)   # first yield
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:143: in pytest_runtest_teardown
    self.resumecapture()
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:90: in resumecapture
    self._capturing.resume_capturing()
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:307: in resume_capturing
    self.err.resume()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <FDCapture 2 oldfd=9>

    def resume(self):
        self.syscapture.resume()
>       os.dup2(self.tmpfile_fd, self.targetfd)
E       OSError: [Errno 9] Bad file descriptor

C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:401: OSError
____________________ ERROR at setup of test_clipping[pdf] _____________________

self = <CallInfo when='setup' exception: [Errno 9] Bad file descriptor>
func = <function call_runtest_hook.<locals>.<lambda> at 0x00000000160561E0>
when = 'setup'

    def __init__(self, func, when):
        #: context of invocation: one of "setup", "call",
        #: "teardown", "memocollect"
        self.when = when
        self.start = time()
        try:
>           self.result = func()

C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\runner.py:196:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\runner.py:182: in <lambda>
    return CallInfo(lambda: ihook(item=item, **kwds), when=when)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:745: in __call__
    return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:339: in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:334: in <lambda>
    _MultiCall(methods, kwargs, hook.spec_opts).execute()
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:613: in execute
    return _wrapped_call(hook_impl.function(*args), self.execute)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:245: in _wrapped_call
    next(wrap_controller)   # first yield
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:129: in pytest_runtest_setup
    self.resumecapture()
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:90: in resumecapture
    self._capturing.resume_capturing()
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:307: in resume_capturing
    self.err.resume()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <FDCapture 2 oldfd=9>

    def resume(self):
        self.syscapture.resume()
>       os.dup2(self.tmpfile_fd, self.targetfd)
E       OSError: [Errno 9] Bad file descriptor

C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:401: OSError
___________________ ERROR at teardown of test_clipping[pdf] ___________________

self = <CallInfo when='teardown' exception: [Errno 9] Bad file descriptor>
func = <function call_runtest_hook.<locals>.<lambda> at 0x000000000501B510>
when = 'teardown'

    def __init__(self, func, when):
        #: context of invocation: one of "setup", "call",
        #: "teardown", "memocollect"
        self.when = when
        self.start = time()
        try:
>           self.result = func()

C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\runner.py:196:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\runner.py:182: in <lambda>
    return CallInfo(lambda: ihook(item=item, **kwds), when=when)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:745: in __call__
    return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:339: in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:334: in <lambda>
    _MultiCall(methods, kwargs, hook.spec_opts).execute()
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:613: in execute
    return _wrapped_call(hook_impl.function(*args), self.execute)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:245: in _wrapped_call
    next(wrap_controller)   # first yield
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:143: in pytest_runtest_teardown
    self.resumecapture()
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:90: in resumecapture
    self._capturing.resume_capturing()
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:307: in resume_capturing
    self.err.resume()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <FDCapture 2 oldfd=9>

    def resume(self):
        self.syscapture.resume()
>       os.dup2(self.tmpfile_fd, self.targetfd)
E       OSError: [Errno 9] Bad file descriptor

C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:401: OSError
____________________ ERROR at setup of test_clipping[svg] _____________________

self = <CallInfo when='setup' exception: [Errno 9] Bad file descriptor>
func = <function call_runtest_hook.<locals>.<lambda> at 0x000000000501B1E0>
when = 'setup'

    def __init__(self, func, when):
        #: context of invocation: one of "setup", "call",
        #: "teardown", "memocollect"
        self.when = when
        self.start = time()
        try:
>           self.result = func()

C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\runner.py:196:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\runner.py:182: in <lambda>
    return CallInfo(lambda: ihook(item=item, **kwds), when=when)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:745: in __call__
    return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:339: in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:334: in <lambda>
    _MultiCall(methods, kwargs, hook.spec_opts).execute()
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:613: in execute
    return _wrapped_call(hook_impl.function(*args), self.execute)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:245: in _wrapped_call
    next(wrap_controller)   # first yield
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:129: in pytest_runtest_setup
    self.resumecapture()
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:90: in resumecapture
    self._capturing.resume_capturing()
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:307: in resume_capturing
    self.err.resume()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <FDCapture 2 oldfd=9>

    def resume(self):
        self.syscapture.resume()
>       os.dup2(self.tmpfile_fd, self.targetfd)
E       OSError: [Errno 9] Bad file descriptor

C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:401: OSError
___________________ ERROR at teardown of test_clipping[svg] ___________________

self = <CallInfo when='teardown' exception: [Errno 9] Bad file descriptor>
func = <function call_runtest_hook.<locals>.<lambda> at 0x0000000005021E18>
when = 'teardown'

    def __init__(self, func, when):
        #: context of invocation: one of "setup", "call",
        #: "teardown", "memocollect"
        self.when = when
        self.start = time()
        try:
>           self.result = func()

C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\runner.py:196:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\runner.py:182: in <lambda>
    return CallInfo(lambda: ihook(item=item, **kwds), when=when)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:745: in __call__
    return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:339: in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:334: in <lambda>
    _MultiCall(methods, kwargs, hook.spec_opts).execute()
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:613: in execute
    return _wrapped_call(hook_impl.function(*args), self.execute)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:245: in _wrapped_call
    next(wrap_controller)   # first yield
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:143: in pytest_runtest_teardown
    self.resumecapture()
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:90: in resumecapture
    self._capturing.resume_capturing()
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:307: in resume_capturing
    self.err.resume()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <FDCapture 2 oldfd=9>

    def resume(self):
        self.syscapture.resume()
>       os.dup2(self.tmpfile_fd, self.targetfd)
E       OSError: [Errno 9] Bad file descriptor

C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:401: OSError
_____________________ ERROR at setup of test_cull_markers _____________________

self = <CallInfo when='setup' exception: [Errno 9] Bad file descriptor>
func = <function call_runtest_hook.<locals>.<lambda> at 0x0000000005A1EF28>
when = 'setup'

    def __init__(self, func, when):
        #: context of invocation: one of "setup", "call",
        #: "teardown", "memocollect"
        self.when = when
        self.start = time()
        try:
>           self.result = func()

C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\runner.py:196:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\runner.py:182: in <lambda>
    return CallInfo(lambda: ihook(item=item, **kwds), when=when)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:745: in __call__
    return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:339: in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:334: in <lambda>
    _MultiCall(methods, kwargs, hook.spec_opts).execute()
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:613: in execute
    return _wrapped_call(hook_impl.function(*args), self.execute)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:245: in _wrapped_call
    next(wrap_controller)   # first yield
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:129: in pytest_runtest_setup
    self.resumecapture()
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:90: in resumecapture
    self._capturing.resume_capturing()
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:307: in resume_capturing
    self.err.resume()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <FDCapture 2 oldfd=9>

    def resume(self):
        self.syscapture.resume()
>       os.dup2(self.tmpfile_fd, self.targetfd)
E       OSError: [Errno 9] Bad file descriptor

C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:401: OSError
___________________ ERROR at teardown of test_cull_markers ____________________

self = <CallInfo when='teardown' exception: [Errno 9] Bad file descriptor>
func = <function call_runtest_hook.<locals>.<lambda> at 0x0000000005021AE8>
when = 'teardown'

    def __init__(self, func, when):
        #: context of invocation: one of "setup", "call",
        #: "teardown", "memocollect"
        self.when = when
        self.start = time()
        try:
>           self.result = func()

C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\runner.py:196:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\runner.py:182: in <lambda>
    return CallInfo(lambda: ihook(item=item, **kwds), when=when)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:745: in __call__
    return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:339: in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:334: in <lambda>
    _MultiCall(methods, kwargs, hook.spec_opts).execute()
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:613: in execute
    return _wrapped_call(hook_impl.function(*args), self.execute)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:245: in _wrapped_call
    next(wrap_controller)   # first yield
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:143: in pytest_runtest_teardown
    self.resumecapture()
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:90: in resumecapture
    self._capturing.resume_capturing()
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:307: in resume_capturing
    self.err.resume()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <FDCapture 2 oldfd=9>

    def resume(self):
        self.syscapture.resume()
>       os.dup2(self.tmpfile_fd, self.targetfd)
E       OSError: [Errno 9] Bad file descriptor

C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:401: OSError
____________________ ERROR at setup of test_hatching[png] _____________________

self = <CallInfo when='setup' exception: [Errno 9] Bad file descriptor>
func = <function call_runtest_hook.<locals>.<lambda> at 0x0000000005021840>
when = 'setup'

    def __init__(self, func, when):
        #: context of invocation: one of "setup", "call",
        #: "teardown", "memocollect"
        self.when = when
        self.start = time()
        try:
>           self.result = func()

C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\runner.py:196:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\runner.py:182: in <lambda>
    return CallInfo(lambda: ihook(item=item, **kwds), when=when)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:745: in __call__
    return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:339: in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:334: in <lambda>
    _MultiCall(methods, kwargs, hook.spec_opts).execute()
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:613: in execute
    return _wrapped_call(hook_impl.function(*args), self.execute)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:245: in _wrapped_call
    next(wrap_controller)   # first yield
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:129: in pytest_runtest_setup
    self.resumecapture()
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:90: in resumecapture
    self._capturing.resume_capturing()
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:307: in resume_capturing
    self.err.resume()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <FDCapture 2 oldfd=9>

    def resume(self):
        self.syscapture.resume()
>       os.dup2(self.tmpfile_fd, self.targetfd)
E       OSError: [Errno 9] Bad file descriptor

C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:401: OSError
___________________ ERROR at teardown of test_hatching[png] ___________________

self = <CallInfo when='teardown' exception: [Errno 9] Bad file descriptor>
func = <function call_runtest_hook.<locals>.<lambda> at 0x0000000005A1EF28>
when = 'teardown'

    def __init__(self, func, when):
        #: context of invocation: one of "setup", "call",
        #: "teardown", "memocollect"
        self.when = when
        self.start = time()
        try:
>           self.result = func()

C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\runner.py:196:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\runner.py:182: in <lambda>
    return CallInfo(lambda: ihook(item=item, **kwds), when=when)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:745: in __call__
    return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:339: in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:334: in <lambda>
    _MultiCall(methods, kwargs, hook.spec_opts).execute()
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:613: in execute
    return _wrapped_call(hook_impl.function(*args), self.execute)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:245: in _wrapped_call
    next(wrap_controller)   # first yield
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:143: in pytest_runtest_teardown
    self.resumecapture()
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:90: in resumecapture
    self._capturing.resume_capturing()
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:307: in resume_capturing
    self.err.resume()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <FDCapture 2 oldfd=9>

    def resume(self):
        self.syscapture.resume()
>       os.dup2(self.tmpfile_fd, self.targetfd)
E       OSError: [Errno 9] Bad file descriptor

C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:401: OSError
____________________ ERROR at setup of test_hatching[pdf] _____________________

self = <CallInfo when='setup' exception: [Errno 9] Bad file descriptor>
func = <function call_runtest_hook.<locals>.<lambda> at 0x0000000016056268>
when = 'setup'

    def __init__(self, func, when):
        #: context of invocation: one of "setup", "call",
        #: "teardown", "memocollect"
        self.when = when
        self.start = time()
        try:
>           self.result = func()

C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\runner.py:196:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\runner.py:182: in <lambda>
    return CallInfo(lambda: ihook(item=item, **kwds), when=when)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:745: in __call__
    return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:339: in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:334: in <lambda>
    _MultiCall(methods, kwargs, hook.spec_opts).execute()
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:613: in execute
    return _wrapped_call(hook_impl.function(*args), self.execute)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:245: in _wrapped_call
    next(wrap_controller)   # first yield
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:129: in pytest_runtest_setup
    self.resumecapture()
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:90: in resumecapture
    self._capturing.resume_capturing()
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:307: in resume_capturing
    self.err.resume()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <FDCapture 2 oldfd=9>

    def resume(self):
        self.syscapture.resume()
>       os.dup2(self.tmpfile_fd, self.targetfd)
E       OSError: [Errno 9] Bad file descriptor

C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:401: OSError
___________________ ERROR at teardown of test_hatching[pdf] ___________________

self = <CallInfo when='teardown' exception: [Errno 9] Bad file descriptor>
func = <function call_runtest_hook.<locals>.<lambda> at 0x000000000503CD90>
when = 'teardown'

    def __init__(self, func, when):
        #: context of invocation: one of "setup", "call",
        #: "teardown", "memocollect"
        self.when = when
        self.start = time()
        try:
>           self.result = func()

C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\runner.py:196:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\runner.py:182: in <lambda>
    return CallInfo(lambda: ihook(item=item, **kwds), when=when)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:745: in __call__
    return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:339: in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:334: in <lambda>
    _MultiCall(methods, kwargs, hook.spec_opts).execute()
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:613: in execute
    return _wrapped_call(hook_impl.function(*args), self.execute)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:245: in _wrapped_call
    next(wrap_controller)   # first yield
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:143: in pytest_runtest_teardown
    self.resumecapture()
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:90: in resumecapture
    self._capturing.resume_capturing()
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:307: in resume_capturing
    self.err.resume()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <FDCapture 2 oldfd=9>

    def resume(self):
        self.syscapture.resume()
>       os.dup2(self.tmpfile_fd, self.targetfd)
E       OSError: [Errno 9] Bad file descriptor

C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:401: OSError
____________________ ERROR at setup of test_hatching[svg] _____________________

self = <CallInfo when='setup' exception: [Errno 9] Bad file descriptor>
func = <function call_runtest_hook.<locals>.<lambda> at 0x0000000005021EA0>
when = 'setup'

    def __init__(self, func, when):
        #: context of invocation: one of "setup", "call",
        #: "teardown", "memocollect"
        self.when = when
        self.start = time()
        try:
>           self.result = func()

C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\runner.py:196:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\runner.py:182: in <lambda>
    return CallInfo(lambda: ihook(item=item, **kwds), when=when)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:745: in __call__
    return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:339: in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:334: in <lambda>
    _MultiCall(methods, kwargs, hook.spec_opts).execute()
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:613: in execute
    return _wrapped_call(hook_impl.function(*args), self.execute)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:245: in _wrapped_call
    next(wrap_controller)   # first yield
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:129: in pytest_runtest_setup
    self.resumecapture()
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:90: in resumecapture
    self._capturing.resume_capturing()
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:307: in resume_capturing
    self.err.resume()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <FDCapture 2 oldfd=9>

    def resume(self):
        self.syscapture.resume()
>       os.dup2(self.tmpfile_fd, self.targetfd)
E       OSError: [Errno 9] Bad file descriptor

C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:401: OSError
___________________ ERROR at teardown of test_hatching[svg] ___________________

self = <CallInfo when='teardown' exception: [Errno 9] Bad file descriptor>
func = <function call_runtest_hook.<locals>.<lambda> at 0x000000000503C9D8>
when = 'teardown'

    def __init__(self, func, when):
        #: context of invocation: one of "setup", "call",
        #: "teardown", "memocollect"
        self.when = when
        self.start = time()
        try:
>           self.result = func()

C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\runner.py:196:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\runner.py:182: in <lambda>
    return CallInfo(lambda: ihook(item=item, **kwds), when=when)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:745: in __call__
    return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:339: in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:334: in <lambda>
    _MultiCall(methods, kwargs, hook.spec_opts).execute()
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:613: in execute
    return _wrapped_call(hook_impl.function(*args), self.execute)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:245: in _wrapped_call
    next(wrap_controller)   # first yield
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:143: in pytest_runtest_teardown
    self.resumecapture()
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:90: in resumecapture
    self._capturing.resume_capturing()
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:307: in resume_capturing
    self.err.resume()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <FDCapture 2 oldfd=9>

    def resume(self):
        self.syscapture.resume()
>       os.dup2(self.tmpfile_fd, self.targetfd)
E       OSError: [Errno 9] Bad file descriptor

C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:401: OSError
________________________ ERROR at setup of test_remove ________________________

self = <CallInfo when='setup' exception: [Errno 9] Bad file descriptor>
func = <function call_runtest_hook.<locals>.<lambda> at 0x000000000503CEA0>
when = 'setup'

    def __init__(self, func, when):
        #: context of invocation: one of "setup", "call",
        #: "teardown", "memocollect"
        self.when = when
        self.start = time()
        try:
>           self.result = func()

C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\runner.py:196:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\runner.py:182: in <lambda>
    return CallInfo(lambda: ihook(item=item, **kwds), when=when)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:745: in __call__
    return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:339: in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:334: in <lambda>
    _MultiCall(methods, kwargs, hook.spec_opts).execute()
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:613: in execute
    return _wrapped_call(hook_impl.function(*args), self.execute)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:245: in _wrapped_call
    next(wrap_controller)   # first yield
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:129: in pytest_runtest_setup
    self.resumecapture()
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:90: in resumecapture
    self._capturing.resume_capturing()
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:307: in resume_capturing
    self.err.resume()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <FDCapture 2 oldfd=9>

    def resume(self):
        self.syscapture.resume()
>       os.dup2(self.tmpfile_fd, self.targetfd)
E       OSError: [Errno 9] Bad file descriptor

C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:401: OSError
______________________ ERROR at teardown of test_remove _______________________

self = <CallInfo when='teardown' exception: [Errno 9] Bad file descriptor>
func = <function call_runtest_hook.<locals>.<lambda> at 0x0000000005A1EF28>
when = 'teardown'

    def __init__(self, func, when):
        #: context of invocation: one of "setup", "call",
        #: "teardown", "memocollect"
        self.when = when
        self.start = time()
        try:
>           self.result = func()

C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\runner.py:196:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\runner.py:182: in <lambda>
    return CallInfo(lambda: ihook(item=item, **kwds), when=when)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:745: in __call__
    return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:339: in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:334: in <lambda>
    _MultiCall(methods, kwargs, hook.spec_opts).execute()
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:613: in execute
    return _wrapped_call(hook_impl.function(*args), self.execute)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:245: in _wrapped_call
    next(wrap_controller)   # first yield
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:143: in pytest_runtest_teardown
    self.resumecapture()
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:90: in resumecapture
    self._capturing.resume_capturing()
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:307: in resume_capturing
    self.err.resume()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <FDCapture 2 oldfd=9>

    def resume(self):
        self.syscapture.resume()
>       os.dup2(self.tmpfile_fd, self.targetfd)
E       OSError: [Errno 9] Bad file descriptor

C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:401: OSError
__________________ ERROR at setup of test_default_edges[png] __________________

self = <CallInfo when='setup' exception: [Errno 9] Bad file descriptor>
func = <function call_runtest_hook.<locals>.<lambda> at 0x000000000503CD90>
when = 'setup'

    def __init__(self, func, when):
        #: context of invocation: one of "setup", "call",
        #: "teardown", "memocollect"
        self.when = when
        self.start = time()
        try:
>           self.result = func()

C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\runner.py:196:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\runner.py:182: in <lambda>
    return CallInfo(lambda: ihook(item=item, **kwds), when=when)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:745: in __call__
    return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:339: in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:334: in <lambda>
    _MultiCall(methods, kwargs, hook.spec_opts).execute()
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:613: in execute
    return _wrapped_call(hook_impl.function(*args), self.execute)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:245: in _wrapped_call
    next(wrap_controller)   # first yield
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:129: in pytest_runtest_setup
    self.resumecapture()
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:90: in resumecapture
    self._capturing.resume_capturing()
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:307: in resume_capturing
    self.err.resume()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <FDCapture 2 oldfd=9>

    def resume(self):
        self.syscapture.resume()
>       os.dup2(self.tmpfile_fd, self.targetfd)
E       OSError: [Errno 9] Bad file descriptor

C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:401: OSError
________________ ERROR at teardown of test_default_edges[png] _________________

self = <CallInfo when='teardown' exception: [Errno 9] Bad file descriptor>
func = <function call_runtest_hook.<locals>.<lambda> at 0x00000000056DBE18>
when = 'teardown'

    def __init__(self, func, when):
        #: context of invocation: one of "setup", "call",
        #: "teardown", "memocollect"
        self.when = when
        self.start = time()
        try:
>           self.result = func()

C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\runner.py:196:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\runner.py:182: in <lambda>
    return CallInfo(lambda: ihook(item=item, **kwds), when=when)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:745: in __call__
    return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:339: in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:334: in <lambda>
    _MultiCall(methods, kwargs, hook.spec_opts).execute()
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:613: in execute
    return _wrapped_call(hook_impl.function(*args), self.execute)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:245: in _wrapped_call
    next(wrap_controller)   # first yield
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:143: in pytest_runtest_teardown
    self.resumecapture()
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:90: in resumecapture
    self._capturing.resume_capturing()
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:307: in resume_capturing
    self.err.resume()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <FDCapture 2 oldfd=9>

    def resume(self):
        self.syscapture.resume()
>       os.dup2(self.tmpfile_fd, self.targetfd)
E       OSError: [Errno 9] Bad file descriptor

C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:401: OSError
______________________ ERROR at setup of test_properties ______________________

self = <CallInfo when='setup' exception: [Errno 9] Bad file descriptor>
func = <function call_runtest_hook.<locals>.<lambda> at 0x0000000005021D90>
when = 'setup'

    def __init__(self, func, when):
        #: context of invocation: one of "setup", "call",
        #: "teardown", "memocollect"
        self.when = when
        self.start = time()
        try:
>           self.result = func()

C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\runner.py:196:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\runner.py:182: in <lambda>
    return CallInfo(lambda: ihook(item=item, **kwds), when=when)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:745: in __call__
    return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:339: in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:334: in <lambda>
    _MultiCall(methods, kwargs, hook.spec_opts).execute()
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:613: in execute
    return _wrapped_call(hook_impl.function(*args), self.execute)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:245: in _wrapped_call
    next(wrap_controller)   # first yield
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:129: in pytest_runtest_setup
    self.resumecapture()
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:90: in resumecapture
    self._capturing.resume_capturing()
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:307: in resume_capturing
    self.err.resume()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <FDCapture 2 oldfd=9>

    def resume(self):
        self.syscapture.resume()
>       os.dup2(self.tmpfile_fd, self.targetfd)
E       OSError: [Errno 9] Bad file descriptor

C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:401: OSError
____________________ ERROR at teardown of test_properties _____________________

self = <CallInfo when='teardown' exception: [Errno 9] Bad file descriptor>
func = <function call_runtest_hook.<locals>.<lambda> at 0x00000000056DBAE8>
when = 'teardown'

    def __init__(self, func, when):
        #: context of invocation: one of "setup", "call",
        #: "teardown", "memocollect"
        self.when = when
        self.start = time()
        try:
>           self.result = func()

C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\runner.py:196:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\runner.py:182: in <lambda>
    return CallInfo(lambda: ihook(item=item, **kwds), when=when)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:745: in __call__
    return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:339: in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:334: in <lambda>
    _MultiCall(methods, kwargs, hook.spec_opts).execute()
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:613: in execute
    return _wrapped_call(hook_impl.function(*args), self.execute)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:245: in _wrapped_call
    next(wrap_controller)   # first yield
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:143: in pytest_runtest_teardown
    self.resumecapture()
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:90: in resumecapture
    self._capturing.resume_capturing()
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:307: in resume_capturing
    self.err.resume()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <FDCapture 2 oldfd=9>

    def resume(self):
        self.syscapture.resume()
>       os.dup2(self.tmpfile_fd, self.targetfd)
E       OSError: [Errno 9] Bad file descriptor

C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:401: OSError
_________________________ ERROR at setup of test_setp _________________________

self = <CallInfo when='setup' exception: [Errno 9] Bad file descriptor>
func = <function call_runtest_hook.<locals>.<lambda> at 0x00000000056DB840>
when = 'setup'

    def __init__(self, func, when):
        #: context of invocation: one of "setup", "call",
        #: "teardown", "memocollect"
        self.when = when
        self.start = time()
        try:
>           self.result = func()

C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\runner.py:196:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\runner.py:182: in <lambda>
    return CallInfo(lambda: ihook(item=item, **kwds), when=when)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:745: in __call__
    return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:339: in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:334: in <lambda>
    _MultiCall(methods, kwargs, hook.spec_opts).execute()
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:613: in execute
    return _wrapped_call(hook_impl.function(*args), self.execute)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:245: in _wrapped_call
    next(wrap_controller)   # first yield
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:129: in pytest_runtest_setup
    self.resumecapture()
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:90: in resumecapture
    self._capturing.resume_capturing()
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:307: in resume_capturing
    self.err.resume()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <FDCapture 2 oldfd=9>

    def resume(self):
        self.syscapture.resume()
>       os.dup2(self.tmpfile_fd, self.targetfd)
E       OSError: [Errno 9] Bad file descriptor

C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:401: OSError
_______________________ ERROR at teardown of test_setp ________________________

self = <CallInfo when='teardown' exception: [Errno 9] Bad file descriptor>
func = <function call_runtest_hook.<locals>.<lambda> at 0x0000000005A1EF28>
when = 'teardown'

    def __init__(self, func, when):
        #: context of invocation: one of "setup", "call",
        #: "teardown", "memocollect"
        self.when = when
        self.start = time()
        try:
>           self.result = func()

C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\runner.py:196:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\runner.py:182: in <lambda>
    return CallInfo(lambda: ihook(item=item, **kwds), when=when)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:745: in __call__
    return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:339: in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:334: in <lambda>
    _MultiCall(methods, kwargs, hook.spec_opts).execute()
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:613: in execute
    return _wrapped_call(hook_impl.function(*args), self.execute)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:245: in _wrapped_call
    next(wrap_controller)   # first yield
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:143: in pytest_runtest_teardown
    self.resumecapture()
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:90: in resumecapture
    self._capturing.resume_capturing()
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:307: in resume_capturing
    self.err.resume()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <FDCapture 2 oldfd=9>

    def resume(self):
        self.syscapture.resume()
>       os.dup2(self.tmpfile_fd, self.targetfd)
E       OSError: [Errno 9] Bad file descriptor

C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:401: OSError
================================== FAILURES ===================================
__________________ test_save_animation_smoketest[null-null] ___________________

self = <CallInfo when='call' exception: [Errno 9] Bad file descriptor>
func = <function call_runtest_hook.<locals>.<lambda> at 0x0000000006C21E18>
when = 'call'

    def __init__(self, func, when):
        #: context of invocation: one of "setup", "call",
        #: "teardown", "memocollect"
        self.when = when
        self.start = time()
        try:
>           self.result = func()

C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\runner.py:196:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\runner.py:182: in <lambda>
    return CallInfo(lambda: ihook(item=item, **kwds), when=when)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:745: in __call__
    return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:339: in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:334: in <lambda>
    _MultiCall(methods, kwargs, hook.spec_opts).execute()
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:613: in execute
    return _wrapped_call(hook_impl.function(*args), self.execute)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\vendored_packages\pluggy.py:250: in _wrapped_call
    wrap_controller.send(call_outcome)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:139: in pytest_runtest_call
    self.suspendcapture_item(item, "call")
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:156: in suspendcapture_item
    out, err = self.suspendcapture(in_=in_)
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:97: in suspendcapture
    outerr = cap.readouterr()
C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:327: in readouterr
    self.err.snap() if self.err is not None else "")
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <FDCapture 2 oldfd=9>

    def snap(self):
        f = self.tmpfile
>       f.seek(0)
E       OSError: [Errno 9] Bad file descriptor

C:\Miniconda2\envs\pyenv36\lib\site-packages\_pytest\capture.py:375: OSError
========== 1 failed, 11 passed, 8 skipped, 31 error in 13.49 seconds ==========
sys:1: ResourceWarning: unclosed file <_io.FileIO name=12 mode='rb+' closefd=True>

@Kojoley
Copy link
Member

Kojoley commented Oct 11, 2017

FINALLY: It is a CPython bug, and it is already fixed in upstream python/cpython#1224

@cgohlke
Copy link
Contributor

cgohlke commented Oct 11, 2017

How about removing Python 3.5 from Appveyor testing as this bug will never be fixed in official CPython 3.5 binaries? Python 3.6.3 contains this bug fix and passes Appveyor testing.

Also, the PyFile_Dup and PyFile_DupClose functions should probably be updated to match the numpy ones?

@Kojoley
Copy link
Member

Kojoley commented Oct 11, 2017

Only v3.7.0a1 has that fix at this point.

@cgohlke
Copy link
Contributor

cgohlke commented Oct 11, 2017

Only v3.7.0a1 has this fix at this point.

python/cpython@e76cb43

@Kojoley
Copy link
Member

Kojoley commented Oct 11, 2017

Maybe I was fooled by GitHub
image
but my latest conda's Python 3.6.2 does not have the fix.

@cgohlke
Copy link
Contributor

cgohlke commented Oct 11, 2017

Python 3.6.3 contains this bug fix. Unfortunately it also contains a faulthandler version that prints all the caught C++ exception messages. Probably it should be disabled on Appveyor for that version?

@Kojoley
Copy link
Member

Kojoley commented Oct 11, 2017

Indeed Python 3.6.3 does have it.

@Kojoley
Copy link
Member

Kojoley commented Oct 11, 2017

Probably it should be disabled on Appveyor for that version?

As we see, on windows faulthandler is completely useless, so I would just remove it from appveyor, for a while at least.

@anntzer
Copy link
Contributor

anntzer commented Oct 11, 2017

Can we replace 3.5 by 3.4 on Appveyor?

@cgohlke
Copy link
Contributor

cgohlke commented Oct 11, 2017

Can we replace 3.5 by 3.4 on Appveyor?

3.4 contains that bug too.

@Kojoley
Copy link
Member

Kojoley commented Oct 11, 2017

I am for removing 3.5 from appveyor, but patch -u -p 1 -i ...\1224.patch -d path\to\python could be used if we leave it.

What about faulthandler and C++ exceptions there is a thread https://bugs.python.org/issue31701 and a fix python/cpython#3929

@anntzer
Copy link
Contributor

anntzer commented Oct 11, 2017

If I understand correctly we did not see the bug before because it's due to a change in the CRT? or something else?

@Kojoley
Copy link
Member

Kojoley commented Oct 11, 2017

@anntzer I had seen problems with descriptors a year ago and that's why pytest-xdist is not activated on appveyor. Nothing changed to CRT, it just sometimes crashes on a bad value, while other time not (we do not know what happens here, because it is distributed without sources). When I installed debug python (python_d) and run simple pip install . on mpl sources it crashed python (thanks to versioneer). After some time I figured that subprocess.Popen with PIPE's would crash the python_d.

@tacaswell
Copy link
Member

👍 to dropping 3.5 from the test matrix and documenting this issue in the windows install docs.

@dstansby
Copy link
Member Author

Thanks a lot to everyone who chased this one!

@tacaswell
Copy link
Member

Thanks @Kojoley and @cgohlke !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants