Closed cnpryer closed 2 years ago
what if we did a little more and also replaced eprint
with raise
es where eprint
was called and where sys.stderr.write
is called?
https://github.com/dilshod/xlsx2csv/blob/ee4d40cf543903a44083a92c97a1912af719ff0e/xlsx2csv.py#L1118
edit: added to the PR (see above)
@ghuls! You're the best. Thanks for the pointers.
Now that I'm curious, is it more ideal to use sys.stderr.write
+ a sys.exit
or should this just throw a sys.exit
?
@ghuls! You're the best. Thanks for the pointers.
Now that I'm curious, is it more ideal to use
sys.stderr.write
+ asys.exit
or should this just throw asys.exit
?
Seems like sys.exit is viable for writing the error message.
What about this guy under the main
https://github.com/dilshod/xlsx2csv/blob/ee4d40cf543903a44083a92c97a1912af719ff0e/xlsx2csv.py#L1205
It should be hanlded by: https://github.com/dilshod/xlsx2csv/blob/ee4d40cf543903a44083a92c97a1912af719ff0e/xlsx2csv.py#L1205 , but could also be handled explicitly.
This should also raise a InvalidXlsxFileException exception: https://github.com/dilshod/xlsx2csv/blob/ee4d40cf543903a44083a92c97a1912af719ff0e/xlsx2csv.py#L1039
It seems good
fixes #233 by
eprint
calls with directXlsxValueError
raisessys.exit
directly