Title: Fix several ResourceWarnings: unclose file by BoboTiG · Pull Request #46 · glamp/bashplotlib · GitHub
Open Graph Title: Fix several ResourceWarnings: unclose file by BoboTiG · Pull Request #46 · glamp/bashplotlib
X Title: Fix several ResourceWarnings: unclose file by BoboTiG · Pull Request #46 · glamp/bashplotlib
Description: Hello,
This is a little patch for resource leaks such as:
$ python setup.py install
setup.py:14: ResourceWarning: unclosed file <_io.TextIOWrapper name='README.rst' mode='r' encoding='UTF-8'>
long_description=open("README.rst").read(),
running install
...
$ bash examples/sample.sh
scatterplot.py:100: ResourceWarning: unclosed file <_io.TextIOWrapper name='examples/data/texas.txt' mode='r' encoding='UTF-8'>
plot_scatter(opts.f, opts.x, opts.y, opts.size, opts.pch, opts.colour, opts.t)
with x and y coords
scatterplot.py:57: ResourceWarning: unclosed file <_io.TextIOWrapper name='examples/data/x_test.txt' mode='r' encoding='UTF-8'>
xs = [float(str(row).strip()) for row in open(xs)]
scatterplot.py:58: ResourceWarning: unclosed file <_io.TextIOWrapper name='examples/data/y_test.txt' mode='r' encoding='UTF-8'>
ys = [float(str(row).strip()) for row in open(ys)]
histogram.py:109: ResourceWarning: unclosed file <_io.TextIOWrapper name='examples/data/exp.txt' mode='r' encoding='UTF-8'>
f = open(f).readlines()
I also fixed this error:
Traceback (most recent call last):
File ".../bin/scatter", line 11, in
Open Graph Description: Hello, This is a little patch for resource leaks such as: $ python setup.py install setup.py:14: ResourceWarning: unclosed file <_io.TextIOWrapper name='README.rst' mode='r' enco...
X Description: Hello, This is a little patch for resource leaks such as: $ python setup.py install setup.py:14: ResourceWarning: unclosed file <_io.TextIOWrapper name='README.rst' mode=&...
Opengraph URL: https://github.com/glamp/bashplotlib/pull/46
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:31f4c7d8-b5ed-6f53-2ecd-6613c9cf59f9 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | E80A:1FDEED:912E00:B9A7AF:697F9E36 |
| html-safe-nonce | 3ac71b78c0964ada5467c4e754ca50b1cffdbc9d5f22aaa9e824d459754ca812 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFODBBOjFGREVFRDo5MTJFMDA6QjlBN0FGOjY5N0Y5RTM2IiwidmlzaXRvcl9pZCI6IjYyNDI0Mjc4NDYyNzk1MzYxODIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 1717be011004268f3db2aef08a9eca493f3d85a8c5ca16ddbec119d09dacdbf5 |
| hovercard-subject-tag | pull_request:241765584 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/glamp/bashplotlib/pull/46/files |
| twitter:image | https://avatars.githubusercontent.com/u/2033598?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/2033598?s=400&v=4 |
| og:image:alt | Hello, This is a little patch for resource leaks such as: $ python setup.py install setup.py:14: ResourceWarning: unclosed file <_io.TextIOWrapper name='README.rst' mode='r' enco... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 60279d4097367e16897439d16d6bbe4180663db828c666eeed2656988ffe59f6 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/glamp/bashplotlib git https://github.com/glamp/bashplotlib.git |
| octolytics-dimension-user_id | 1409333 |
| octolytics-dimension-user_login | glamp |
| octolytics-dimension-repository_id | 7142310 |
| octolytics-dimension-repository_nwo | glamp/bashplotlib |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 7142310 |
| octolytics-dimension-repository_network_root_nwo | glamp/bashplotlib |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7c85641c598ad130c74f7bcc27f58575cac69551 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width