Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trying to upload a CSV should prompt a format error #103

Open
matt-bernhardt opened this issue Mar 13, 2016 · 0 comments
Open

Trying to upload a CSV should prompt a format error #103

matt-bernhardt opened this issue Mar 13, 2016 · 0 comments
Assignees

Comments

@matt-bernhardt
Copy link
Owner

Trying to import a CSV file into the import-games verb results in the following output:

$ trapp import-games nasl_2016_prepped_cropped.csv
Importing games from nasl_2016_prepped_cropped.csv
Traceback (most recent call last):
  File "C:\Python27\Scripts\trapp-script.py", line 9, in <module>
    load_entry_point('trapp==0.3.0a1', 'console_scripts', 'trapp')()
  File "c:\users\mjbernha\documents\github\trapp\trapp\command_line.py", line 288, in main
    verbImport(args)
  File "c:\users\mjbernha\documents\github\trapp\trapp\command_line.py", line 203, in verbImport
    importGames(args.infile)
  File "c:\users\mjbernha\documents\github\trapp\trapp\command_line.py", line 75, in importGames
    importer = ImporterGames(infile, log)
  File "c:\users\mjbernha\documents\github\trapp\trapp\importer.py", line 20, in __init__
    self.source = Spreadsheet(importFile)
  File "c:\users\mjbernha\documents\github\trapp\trapp\spreadsheet.py", line 9, in __init__
    self.data = open_workbook(file)
  File "c:\python27\lib\site-packages\xlrd-0.9.4-py2.7.egg\xlrd\__init__.py", line 441, in open_workbook
    ragged_rows=ragged_rows,
  File "c:\python27\lib\site-packages\xlrd-0.9.4-py2.7.egg\xlrd\book.py", line 91, in open_workbook_xls
    biff_version = bk.getbof(XL_WORKBOOK_GLOBALS)
  File "c:\python27\lib\site-packages\xlrd-0.9.4-py2.7.egg\xlrd\book.py", line 1230, in getbof
    bof_error('Expected BOF record; found %r' % self.mem[savpos:savpos+8])
  File "c:\python27\lib\site-packages\xlrd-0.9.4-py2.7.egg\xlrd\book.py", line 1224, in bof_error
    raise XLRDError('Unsupported format, or corrupt file: ' + msg)
xlrd.biffh.XLRDError: Unsupported format, or corrupt file: Expected BOF record; found 'MatchTim'

Ideally, something in this should advise the user that an XLSX file is needed. Even better, a CSV file could be accepted - but at least a better error message.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant