Page MenuHomeVyOS Platform

Python configuration manipulation library leaks open files
Closed, ResolvedPublicBUG

Description

/usr/lib/python3/dist-packages/vyos/configsession.py:110: ResourceWarning: unclosed file <_io.BufferedReader name=3>
  self.__run_command([CLI_SHELL_API, 'setupSession'])
ResourceWarning: Enable tracemalloc to get the object allocation traceback
/usr/lib/python3/dist-packages/vyos/config.py:102: ResourceWarning: unclosed file <_io.BufferedReader name=3>
  running_config_text = self._run([self._cli_shell_api, '--show-active-only', '--show-show-defaults', '--show-ignore-edit', 'showConfig'])
ResourceWarning: Enable tracemalloc to get the object allocation traceback
/usr/lib/python3/dist-packages/vyos/config.py:225: ResourceWarning: unclosed file <_io.BufferedReader name=3>
  self._run(self._make_command('inSession', ''))
ResourceWarning: Enable tracemalloc to get the object allocation traceback
/usr/lib/python3/dist-packages/vyos/config.py:110: ResourceWarning: unclosed file <_io.BufferedReader name=3>
  session_config_text = self._run([self._cli_shell_api, '--show-working-only', '--show-show-defaults', '--show-ignore-edit', 'showConfig'])
ResourceWarning: Enable tracemalloc to get the object allocation traceback
/usr/lib/python3/dist-packages/vyos/configsession.py:143: ResourceWarning: unclosed file <_io.BufferedReader name=3>
  self.__run_command([DELETE] + path + value)
ResourceWarning: Enable tracemalloc to get the object allocation traceback
/usr/lib/python3/dist-packages/vyos/configsession.py:153: ResourceWarning: unclosed file <_io.BufferedReader name=3>
  out = self.__run_command([COMMIT])
ResourceWarning: Enable tracemalloc to get the object allocation traceback
/usr/lib/python3/dist-packages/vyos/configsession.py:136: ResourceWarning: unclosed file <_io.BufferedReader name=3>
  self.__run_command([SET] + path + value)
ResourceWarning: Enable tracemalloc to get the object allocation traceback
..
----------------------------------------------------------------------
Ran 2 tests in 5.492s

OK

Details

Difficulty level
Easy (less than an hour)
Version
VyOS 1.3-rolling-202001240217
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Behavior change
Issue type
Internal change (not visible to end users)

Event Timeline

dmbaturin claimed this task.
erkin set Issue type to Internal change (not visible to end users).Aug 31 2021, 5:51 PM