simonw/sqlite-utils

Misleading progress bar against utf-16-le CSV input

Aperta

#439 aperta il 27 mag 2022

 (12 commenti) (0 reazioni) (0 assegnatari)Python (145 fork)github user discovery
bughelp wanted

Metriche repository

Star
 (2065 stelle)
Metriche merge PR
 (Merge medio 9h 52m) (7 PR mergiate in 30 g)

Descrizione

The program crashes without any error.

wget "https://artsdatabanken.no/Fab2018/api/export/csv"
sqlite-utils create-database test.db
sqlite-utils insert --csv --delimiter ";" --encoding "utf-16-le" test test.db csv 
  [------------------------------------]    0%
  [#################-------------------]   49%  00:00:01

I would like to highlight various issues:

  1. sqlite-utils catches exceptions without printing the stacktrace and/or reraising the exception, so there is no easy way to use pdb or similar to debug the program, solution: add a debug option
  2. Silent crash: this is related to (1.), and it happens when there is a catch-all mechanism; solution: let the program fail.

Guida contributor