File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,6 +10,9 @@ What's New in Python 3.3 Alpha 1?
1010Core and Builtins
1111-----------------
1212
13+ - Issue #14084: Fix a file descriptor leak when importing a module with a
14+ bad encoding.
15+
1316- Upgrade Unicode data to Unicode 6.1.
1417
1518- Issue #14040: Remove rarely used file name suffixes for C extensions
Original file line number Diff line number Diff line change @@ -3628,11 +3628,9 @@ call_find_module(PyObject *name, PyObject *path_list)
36283628 if (fd != -1 )
36293629 fd = dup (fd );
36303630 fclose (fp );
3631- if (fd == -1 ) {
3632- PyErr_SetFromErrno (PyExc_OSError );
3633- return NULL ;
3634- }
36353631 fp = NULL ;
3632+ if (fd == -1 )
3633+ return PyErr_SetFromErrno (PyExc_OSError );
36363634 }
36373635 if (fd != -1 ) {
36383636 if (strchr (fdp -> mode , 'b' ) == NULL ) {
@@ -3642,6 +3640,7 @@ call_find_module(PyObject *name, PyObject *path_list)
36423640 lseek (fd , 0 , 0 ); /* Reset position */
36433641 if (found_encoding == NULL && PyErr_Occurred ()) {
36443642 Py_XDECREF (pathobj );
3643+ close (fd );
36453644 return NULL ;
36463645 }
36473646 encoding = (found_encoding != NULL ) ? found_encoding :
You can’t perform that action at this time.
0 commit comments