Closed fernandahf closed 1 year ago
Reproduced in py3.8 and py3.9
Following python warning is appearing in PO files with errors:
/home/travis/build/OCA/pylint-odoo/.tox/pylint/lib/python3.9/site-packages/polib.py:1474: ResourceWarning: unclosed file <_io.FileIO name='/home/travis/build/OCA/pylint-odoo/pylint_odoo/test_repo/broken_module2/i18n/en.po' mode='rb' closefd=True>
Above is because code is raising errors while is parsing in the following lines:
https://github.com/izimobil/polib/blob/8e1a86ec9bcab8356bc278666bdb170dec4ad6a2/polib.py#L1434-L1435
And code doesn't reach lines where the file is closed:
https://github.com/izimobil/polib/blob/8e1a86ec9bcab8356bc278666bdb170dec4ad6a2/polib.py#L1460-L1461
I think, file has to be closed regardless if has errors or not
FYI
@moylop260
Reproduced in py3.8 and py3.9
Following python warning is appearing in PO files with errors:
/home/travis/build/OCA/pylint-odoo/.tox/pylint/lib/python3.9/site-packages/polib.py:1474: ResourceWarning: unclosed file <_io.FileIO name='/home/travis/build/OCA/pylint-odoo/pylint_odoo/test_repo/broken_module2/i18n/en.po' mode='rb' closefd=True>
Above is because code is raising errors while is parsing in the following lines:
https://github.com/izimobil/polib/blob/8e1a86ec9bcab8356bc278666bdb170dec4ad6a2/polib.py#L1434-L1435
And code doesn't reach lines where the file is closed:
https://github.com/izimobil/polib/blob/8e1a86ec9bcab8356bc278666bdb170dec4ad6a2/polib.py#L1460-L1461
I think, file has to be closed regardless if has errors or not