Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 691638 - portage.util._xattr._XattrSystemCommands.{get,list} trigger "ResourceWarning: unclosed file <_io.BufferedReader name=...>"
Summary: portage.util._xattr._XattrSystemCommands.{get,list} trigger "ResourceWarning:...
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All All
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks: 691278
  Show dependency tree
 
Reported: 2019-08-07 02:40 UTC by Arfrever Frehtes Taifersar Arahesis
Modified: 2019-11-02 00:34 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch (portage-_XattrSystemCommands.patch,1.28 KB, patch)
2019-08-07 02:48 UTC, Arfrever Frehtes Taifersar Arahesis
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Arfrever Frehtes Taifersar Arahesis 2019-08-07 02:40:22 UTC
>>> import portage.util._xattr
>>> portage.util._xattr._XattrSystemCommands.list("/bin/ping")
__main__:1: ResourceWarning: unclosed file <_io.BufferedReader name=5>
[b'security.capability']
>>> portage.util._xattr._XattrSystemCommands.get("/bin/ping", "security.capability")
__main__:1: ResourceWarning: unclosed file <_io.BufferedReader name=5>
b'0sAQAAAgAgAAAAAAAAAAAAAAAAAAA='


This is due to passing stderr=subprocess.PIPE to subprocess.Popen(), but later stderr is not used at all.
Comment 1 Arfrever Frehtes Taifersar Arahesis 2019-08-07 02:48:06 UTC
Created attachment 585960 [details, diff]
Patch
Comment 2 Larry the Git Cow gentoo-dev 2019-08-08 22:58:05 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/portage.git/commit/?id=90ffe62d5b7b224753927f2fa61daf19488e14f9

commit 90ffe62d5b7b224753927f2fa61daf19488e14f9
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever@Apache.Org>
AuthorDate: 2019-08-07 02:41:51 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2019-08-08 22:57:28 +0000

    _xattr._XattrSystemCommands.{get,list}: Do not hide stderr and fix ResourceWarning.
    
    Bug: https://bugs.gentoo.org/691638
    Signed-off-by: Arfrever Frehtes Taifersar Arahesis <Arfrever@Apache.Org>
    Signed-off-by: Zac Medico <zmedico@gentoo.org>

 lib/portage/util/_xattr.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
Comment 3 Zac Medico gentoo-dev 2019-08-08 22:58:34 UTC
Thanks!
Comment 4 Larry the Git Cow gentoo-dev 2019-08-19 05:06:43 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=08557524dc6c8eec3a366e43ab2587d2cdd8f133

commit 08557524dc6c8eec3a366e43ab2587d2cdd8f133
Author:     Zac Medico <zmedico@gentoo.org>
AuthorDate: 2019-08-19 04:24:07 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2019-08-19 05:06:15 +0000

    sys-apps/portage: Bump to version 2.3.72
    
     #463952 glsa-check: install in /usr/bin
     #646090 preserve-libs: get dep graph from EROOT
     #690484 detect internal collisions for /usr merge
     #690786 repoman: support metadata/layout.conf restrict-allowed
     #691776 unpack: Unconditionally die if an unpacker returns an error
     #691638 Show get/setfattr stderr
     #692024 econf: Unconditionally die on error in EAPIs 0 to 3
     #692262 QA Notice: EXPORT_FUNCTIONS is called before inherit in
             kernel-2.eclass
     #692412 emerge IndexError for ambiguous package atom with pypy
    
    Bug: https://bugs.gentoo.org/691278
    Bug: https://bugs.gentoo.org/463952
    Bug: https://bugs.gentoo.org/646090
    Bug: https://bugs.gentoo.org/690484
    Bug: https://bugs.gentoo.org/690786
    Bug: https://bugs.gentoo.org/691776
    Bug: https://bugs.gentoo.org/691638
    Bug: https://bugs.gentoo.org/692024
    Bug: https://bugs.gentoo.org/692262
    Bug: https://bugs.gentoo.org/692412
    Package-Manager: Portage-2.3.71, Repoman-2.3.17
    Signed-off-by: Zac Medico <zmedico@gentoo.org>

 sys-apps/portage/Manifest              |   1 +
 sys-apps/portage/portage-2.3.72.ebuild | 264 +++++++++++++++++++++++++++++++++
 2 files changed, 265 insertions(+)