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
  • #749
Closed
Open
Issue created Jan 12, 2017 by Administrator@rootContributor

in2csv reading sheets with utf-8 names

Created by: Fil

sheet names in utf-8, containing an accent

The command in2csv --sheet=BÉBÉ file.xls raises: usr/local/lib/python2.7/site-packages/xlrd/book.py:439: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal No sheet named <'B\xc3\x89B\xc3\x89'>

Quick fix in in2csv.py:

        if self.args.sheet:
            kwargs['sheet'] = self.args.sheet.decode('utf-8')

(I think this bug and the fix are because I'm using python2.7)

Another way of getting this sheet is by adding an argument sheetnum with:

        self.argparser.add_argument('--sheetnum', dest='sheetnum',
                                    help='The name of the Excel sheet to operate on.')
…
        if self.args.sheetnum:
            kwargs['sheet'] = int(float(self.args.sheetnum))
Assignee
Assign to
Time tracking