common-workflow-language / common-workflow-language/cwltool

Errors are noisy on python3

Open
#1,126 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
376
Forks
255
Avg merge
2d 7h
Merged PRs (30d)
12

Description

Schema salad and cwltool use a catch and re-raise pattern extensively for managing exceptions. Python3 has different behavior than Python2 around exceptions raised in exception handlers. In Python2, the newly raised exception replaces the current one, and str() only provides the exception message. In Python3, the current exception is saved as an inner exception and the entire exception chain and stack traces are reported in the default str() representation.

Fixes:

* Use six.reraise()
* Adjust logging to explicitly print only the exception message except when --debug is enabled or for unexpected/unhandled exceptions.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.