Page MenuHomePhabricator

ResourceWarning unclosed files py3
Closed, ResolvedPublic

Description

test_XmlDumpAllRevs (tests.xmlreader_tests.XmlReaderTestCase) ... c:\pywiki\core\tests\xmlreader_tests.py:25: ResourceWarning: unclosed file <_io.TextIOWrapper name='c:\\pywiki\\core\\tests\\data\\article-pear.xml' mode='r' encoding='cp
1252'>

pages = [r for r in

ok
test_XmlDumpFirstRev (tests.xmlreader_tests.XmlReaderTestCase) ... c:\pywiki\core\tests\xmlreader_tests.py:38: ResourceWarning: unclosed file <_io.TextIOWrapper name='c:\\pywiki\\core\\tests\\data\\article-pear.xml' mode='r' encoding='c
p1252'>

pages = [r for r in

ok
test_XmlDumpRedirect (tests.xmlreader_tests.XmlReaderTestCase) ... ERROR
c:\Python34\lib\unittest\case.py:605: ResourceWarning: unclosed file <_io.TextIOWrapper name='c:\\pywiki\\core\\tests\\data\\article-pyrus.xml' mode='r' encod
ing='cp1252'>

outcome.errors.clear()

Version: core-(2.0)
Severity: normal

Details

Reference
bz70969

Related Objects

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 3:51 AM
bzimport added a project: Pywikibot-tests.
bzimport set Reference to bz70969.
bzimport added a subscriber: Unknown Object (????).
jayvdb created this task.Sep 17 2014, 10:26 PM

Another unclosed file in

test_user_agent (tests.dry_site_tests.TestDrySite) ... c:\Python34\lib\subprocess.py:754: ResourceWarning: unclosed file <_io.BufferedReader name=3>

_cleanup()

ok

c:\Python34\lib\unittest\suite.py:110: ResourceWarning: unclosed file <_io.TextIOWrapper name='c:\\pywiki\\core\\tests\\data\\csv_ingestion.csv' mode='r' encoding='cp1252'>

for index, test in enumerate(self):

test_getDescription (tests.data_ingestion_tests.TestCSVReader) ... ok
test_getTitle (tests.data_ingestion_tests.TestCSVReader) ... ok
c:\Python34\lib\unittest\suite.py:87: ResourceWarning: unclosed file <_io.TextIOWrapper name='c:\\pywiki\\core\\tests\\data\\csv_ingestion.csv' mode='r' encoding='cp1252'>

return self.run(*args, **kwds)

Change 161195 had a related patch set uploaded by XZise:
[FIX] Close opened files

https://gerrit.wikimedia.org/r/161195

Change 161195 merged by jenkins-bot:
[FIX] Close opened files and open XMLs in binary mode

https://gerrit.wikimedia.org/r/161195

Change 161227 had a related patch set uploaded by XZise:
[FIX] Close csv file and subprocess stdout streams

https://gerrit.wikimedia.org/r/161227

Change 161227 merged by jenkins-bot:
[FIX] Close subprocess stdout streams

https://gerrit.wikimedia.org/r/161227