Fix bad file descriptor error
Fix bad file descriptor error

jupyter/nbgrader,jhamrick/nbgrader,jupyter/nbgrader,jupyter/nbgrader,ellisonbg/nbgrader,EdwardJKim/nbgrader,jhamrick/nbgrader,jhamrick/nbgrader,ellisonbg/nbgrader,ellisonbg/nbgrader,jupyter/nbgrader,jupyter/nbgrader,EdwardJKim/nbgrader,jhamrick/nbgrader,EdwardJKim/nbgrader,EdwardJKim/nbgrader,ellisonbg/nbgrader