Page MenuHomePhabricator

unclosed file in wikimedia_sites.py
Closed, ResolvedPublic

Description

running wikimedia_sites.py with py 3

py -3 pwb.py wikimedia_sites

gives a ResourceWarning:

WARNING: .\scripts\maintenance\wikimedia_sites.py:92: ResourceWarning: unclosed
file <_io.BufferedReader name='pywikibot/families/wiktionary_family.py'>
  family_file = codecs.open(family_file_name, 'w', 'utf8')

Details

Event Timeline

Xqt created this task.May 28 2017, 9:27 AM
Restricted Application added subscribers: pywikibot-bugs-list, Aklapper. · View Herald TranscriptMay 28 2017, 9:27 AM
Xqt triaged this task as Low priority.May 28 2017, 9:29 AM

Change 355902 had a related patch set uploaded (by Mpaa; owner: Mpaa):
[pywikibot/core@master] T166459: Fix ResourceWarning in wikimedia_sites.py

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

Xqt closed this task as Resolved.May 28 2017, 5:26 PM
Xqt assigned this task to Mpaa.

Thx

Change 355902 merged by jenkins-bot:
[pywikibot/core@master] T166459: Fix ResourceWarning in wikimedia_sites.py

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

Xqt reopened this task as Open.Jul 13 2017, 9:22 AM

Reopened because this warning is still alive:

C:\pwb\GIT\core>py -3 pwb.py wikimedia_sites wikisource

Checking family wikisource:
WARNING: ['as'] not listed at wikistats.
The lists don't match, the new list is:
        self.languages_by_size = [
            'en', 'pl', 'ru', 'de', 'fr', 'zh', 'he', 'it', 'es', 'ar', 'cs',
            'pt', 'fa', 'hu', 'www', 'ml', 'ko', 'sv', 'gu', 'sl', 'bn', 'te',
            'sa', 'sr', 'ro', 'fi', 'el', 'uk', 'vi', 'ja', 'th', 'hy', 'az',
            'ca', 'hr', 'ta', 'br', 'nl', 'is', 'la', 'no', 'vec', 'eo', 'tr',
            'be', 'et', 'mk', 'yi', 'id', 'da', 'as', 'bg', 'li', 'mr', 'kn',
            'or', 'bs', 'sah', 'lt', 'gl', 'cy', 'sk', 'zh-min-nan', 'fo',
            'pa',
        ]
WARNING: .\scripts\maintenance\wikimedia_sites.py:90: ResourceWarning: unclosed
file <_io.BufferedReader name='pywikibot/families/wikisource_family.py'>
  with codecs.open(family_file_name, 'w', 'utf8') as family_file:


C:\pwb\GIT\core>
Xqt claimed this task.Jul 13 2017, 9:33 AM
Xqt added a subscriber: Mpaa.

Change 364976 had a related patch set uploaded (by Xqt; owner: Xqt):
[pywikibot/core@master] [bugfix] Fix ResourceWarning in wikimedia_sites.py with python3

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

Change 364976 merged by jenkins-bot:
[pywikibot/core@master] [bugfix] Fix ResourceWarning in wikimedia_sites.py with python3

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

Xqt closed this task as Resolved.Jul 14 2017, 5:45 AM