ssh_paramiko_backend.py: ResourceWarning, unclosed file

Asked by Danilo G. Baio

Hi.

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/ssh_paramiko_backend.py:409: ResourceWarning: unclosed file <_io.TextIOWrapper name='/etc/ssh/ssh_config' mode='r' encoding='UTF-8'>
  sshconfig.parse(open(file))
/usr/local/lib/python3.6/site-packages/duplicity/backends/ssh_paramiko_backend.py:409: ResourceWarning: unclosed file <_io.TextIOWrapper name='/home/dbaio/.ssh/config' mode='r' encoding='UTF-8'>
  sshconfig.parse(open(file))
 [...]
/usr/local/lib/python3.6/site-packages/duplicity/gpg.py:210: 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/gpg.py:210: ResourceWarning: unclosed file <_io.BufferedWriter name=b'/home/dbaio/.cache/duplicity/62b91b46def6e9f6d2f84dff24ad117a/duplicity-full-signatures.201910
06T211032Z.sigtar.gpg'>
  u'logger': self.logger_fp})

Duplicity: 0.8.05
Paramiko: 2.6.0
Python: 3.6

Regards.

Question information

Language:
English Edit question
Status:
Needs information
For:
Duplicity Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Kenneth Loafman (kenneth-loafman) said :
#1

What version of FreeBSD?

What version of GnuPG?

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

Revision history for this message
Danilo G. Baio (dbaio) said :
#2

Hi Kenneth, thanks for taking a look.

GnuPG: 2.2.17
FreeBSD: 13.0-CURRENT

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

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

Revision history for this message
edso (ed.so) said :
#3

seems to be dependend on hwo python was compiled according to
  https://github.com/python-pillow/Pillow/issues/477

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

..ede/duply.net

Revision history for this message
Kenneth Loafman (kenneth-loafman) said :
#4

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

Revision history for this message
Kenneth Loafman (kenneth-loafman) said :
#5

Please respond to bug https://bugs.launchpad.net/duplicity/+bug/1847122 since they are the same issue.

Thanks!

...Ken

Revision history for this message
edso (ed.so) said :
#6

Ken,

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?

..ede/duply.net

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.