From 844c0e473b78d06604d6f06d1bceda9cc6125bdd Mon Sep 17 00:00:00 2001 From: Paul Millar Date: Wed, 10 Jan 2018 12:31:17 +0100 Subject: [PATCH] star: fix printing exception error message Motivation: PEP 352 involves restructuring the exception hierarcy in Python. As part of this, there is a plan to phase out the 'message' attribute over various Python versions. Despite PEP 352 existing for some time, the StAR produce erroneously used the 'message' attribute when printing an error message. This results in no error message being reported with sufficiently recent versions of Python. Modification: Remove 'message' attribute reference; instead, use the implicit string conversion. Result: The dcache-star script should show meaningful error messages if there's a problem when run with newer versions of Python. Target: master Require-notes: yes Require-book: no Request: 4.0 Request: 3.2 Request: 3.1 Request: 3.0 Request: 2.16 Ticket: http://rt.dcache.org/Ticket/Display.html?id=9323 --- skel/bin/dcache-star | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/skel/bin/dcache-star b/skel/bin/dcache-star index 3c5f27abbb7..de2a8f72510 100755 --- a/skel/bin/dcache-star +++ b/skel/bin/dcache-star @@ -278,7 +278,7 @@ def main(): write_records(now) update_last_update(now) except Exception as e: - sys.stderr.write("dcache-star: Problem detected: %s" % e.message) + sys.stderr.write("dcache-star: Problem detected: %s" % e) sys.exit(1)