ResourceWarning: unclosed file - tripleoclient/utils.py:1888

Bug #1836379 reported by Harald Jensås
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tripleo
Fix Released
Medium
Harald Jensås

Bug Description

Several warnings like the one below are on the console when running (re-running) overcloud deploy.

/usr/lib/python3.6/site-packages/tripleoclient/utils.py:1888: ResourceWarning: unclosed file <_io.TextIOWrapper name='/home/stack/templates/nodes_data.yaml' mode='r' encoding='UTF-8'>
  content = yaml.load(open(env_file))

Similar warning also seen in CI, but from tripleoclient/v1/tripleo_deploy.py:1237 in that case.
http://logs.openstack.org/53/670053/1/check/tripleo-ci-fedora-28-standalone/d9af73e/logs/undercloud/home/zuul/standalone_deploy.log.txt.gz#_2019-07-11_09_59_53

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-tripleoclient (master)

Fix proposed to branch: master
Review: https://review.opendev.org/670576

Changed in tripleo:
assignee: nobody → Harald Jensås (harald-jensas)
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-tripleoclient (master)

Reviewed: https://review.opendev.org/670576
Committed: https://git.openstack.org/cgit/openstack/python-tripleoclient/commit/?id=317f3cff7d00d9031a482e26d9149bca6010677c
Submitter: Zuul
Branch: master

commit 317f3cff7d00d9031a482e26d9149bca6010677c
Author: Harald Jensås <email address hidden>
Date: Fri Jul 12 16:50:01 2019 +0200

    Ensure files are closed, ensure no ResourceWarning on console

    Fixes an issue wich cause warnings such as the one below on the
    console when using python3.
      ResourceWarning : unclosed file <_io.TextIOWrapper name='FILENAME'

    Closes-Bug: #1836379
    Change-Id: I4a80a339b2cc0c3fca992cfc456581a91dbf2eef

Changed in tripleo:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-tripleoclient (stable/stein)

Fix proposed to branch: stable/stein
Review: https://review.opendev.org/670821

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-tripleoclient (stable/stein)

Reviewed: https://review.opendev.org/670821
Committed: https://git.openstack.org/cgit/openstack/python-tripleoclient/commit/?id=bffda0183cd27e8cc859e9e0142534689047ddf7
Submitter: Zuul
Branch: stable/stein

commit bffda0183cd27e8cc859e9e0142534689047ddf7
Author: Harald Jensås <email address hidden>
Date: Fri Jul 12 16:50:01 2019 +0200

    Ensure files are closed, ensure no ResourceWarning on console

    Fixes an issue wich cause warnings such as the one below on the
    console when using python3.
      ResourceWarning : unclosed file <_io.TextIOWrapper name='FILENAME'

    Closes-Bug: #1836379
    Change-Id: I4a80a339b2cc0c3fca992cfc456581a91dbf2eef
    (cherry picked from commit 317f3cff7d00d9031a482e26d9149bca6010677c)

tags: added: in-stable-stein
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/python-tripleoclient 12.1.0

This issue was fixed in the openstack/python-tripleoclient 12.1.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/python-tripleoclient 11.5.1

This issue was fixed in the openstack/python-tripleoclient 11.5.1 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.