Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • C csvkit
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 61
    • Issues 61
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 4
    • Merge requests 4
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • wireservice
  • csvkit
  • Issues
  • #838
Closed
Open
Issue created May 26, 2017 by Administrator@rootContributor

csvgrep: "unclosed file" warning

Created by: kfogel

I opened this new issue instead of re-opening issue #693 (closed) -- hope that was the right decision.

There's an "unclosed file" warning still coming from csvgrep. It doesn't reproduce every time, but that's probably just to do with how the process shuts down or something. I could reproduce it pretty reliably if I just invoked the exact same csvgrep command enough times in a row:

$ csvgrep --version
csvgrep 1.0.3
$ csvgrep -c 15 -f myfilters.txt -i input.csv > output.csv
$ csvgrep -c 15 -f myfilters.txt -i input.csv > output.csv
$ csvgrep -c 15 -f myfilters.txt -i input.csv > output.csv
sys:1: ResourceWarning: unclosed file <_io.TextIOWrapper name='myfilters.txt' mode='r' encoding='UTF-8'>
$ 

I have a patch for this, and will file the PR in a moment.

This was with csvgrep freshly installed (via sudo python3 setup.py install --prefix=/usr/local) from csvkit of commit e8027e1f. Python 3.5.3, on a Debian GNU/Linux system running an up-to-date testing' release; uname -a` says "Linux ... 4.9.0-3-amd64 #1 SMP Debian 4.9.25-1 (2017-05-02) x86_64 GNU/Linux".

Assignee
Assign to
Time tracking