Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8c13385

Browse files
dipietrantonioDonJayamanne
authored andcommitted
Fix Issue "OSError: Too Many Open Files (#1072)" (DonJayamanne#1118)
Close the file descriptor "self.oldstdout_fno" after line 24, since it is no more used. Leaving it opened will cause the Too Many Open Files error when the _enter_ function is called many times.
1 parent 42e466f commit 8c13385

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

pythonFiles/completion.py

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ def __enter__(self):
2222
def __exit__(self, exc_type, exc_value, traceback):
2323
self._new_stdout.flush()
2424
os.dup2(self.oldstdout_fno, 1)
25+
os.close(self.oldstdout_fno)
2526

2627
class JediCompletion(object):
2728
basic_types = {

0 commit comments

Comments
 (0)