ResourceWarning, unclosed file

Asked by Danilo G. Baio on 2019-10-06


Upgrading duplicity from 0.7 to 0.8 on FreeBSD and I'm seeing a lot of these messages with sftp+paramiko:

/usr/local/lib/python3.6/site-packages/duplicity/backends/ ResourceWarning: unclosed file <_io.TextIOWrapper name='/etc/ssh/ssh_config' mode='r' encoding='UTF-8'>
/usr/local/lib/python3.6/site-packages/duplicity/backends/ ResourceWarning: unclosed file <_io.TextIOWrapper name='/home/dbaio/.ssh/config' mode='r' encoding='UTF-8'>
/usr/local/lib/python3.6/site-packages/duplicity/ ResourceWarning: unclosed file <_io.BufferedWriter name=b'/tmp/duplicity-s29hbs8p-tempdir/mktemp-ozyor2fj-2'>
  u'logger': self.logger_fp})
/usr/local/lib/python3.6/site-packages/duplicity/ ResourceWarning: unclosed file <_io.BufferedWriter name=b'/home/dbaio/.cache/duplicity/62b91b46def6e9f6d2f84dff24ad117a/duplicity-full-signatures.201910
  u'logger': self.logger_fp})

Duplicity: 0.8.05
Paramiko: 2.6.0
Python: 3.6


Question information

English Edit question
Needs information
Duplicity Edit question
No assignee Edit question
Last query:
Last reply:

What version of FreeBSD?

What version of GnuPG?

This is not happening on Linux or MacOS, so this is new.

Danilo G. Baio (dbaio) said : #2

Hi Kenneth, thanks for taking a look.

GnuPG: 2.2.17

If you want I can test it with FreeBSD 12-RELEASE as well.

If I can help with anything, please, let me know.

edso ( said : #3

seems to be dependend on hwo python was compiled according to

it also says using `python -Wall` will make this reproducable on systems where python per default silences those warnings.


Please do a couple of things, if possible:

- Check to see if Python is compiled with DEBUG
- Make sure that duplicity shebang does not have -Wall
- Check your environment for PYTHON* variables

You can check the cflags options with:
$ python-config --cflags

Please respond to bug since they are the same issue.



edso ( said : #6


we should probably still strive to close the file instances. after all these are the underlying issue why we need so high ulimit values. do you agree?


Can you help with this problem?

Provide an answer of your own, or ask Danilo G. Baio for more information if necessary.

To post a message you must log in.