-
Notifications
You must be signed in to change notification settings - Fork 94
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
Cylc Review: Handle more characters #6171
Comments
Is Cylc review back, or does it still need Cylc7/py2 as per #5937 ? |
It's never gone away. #5937 has recent updates describing current plans. Ultimately we might hope to completely integrate run history into the GUI views, but that's longer term, and it remains to be seen if that would be better than (or preferred over) |
Sadly, resolving this issue would require a code change (can't just hack the problem away in the environment), this appears to work for me: diff --git a/lib/cylc/review.py b/lib/cylc/review.py
index 98543dde8..2401a638a 100644
--- a/lib/cylc/review.py
+++ b/lib/cylc/review.py
@@ -596,9 +596,10 @@ class CylcReviewService(object):
return cherrypy.lib.static.serve_file(f_name, mime)
text = open(f_name).read()
try:
+ text = unicode(text, 'UTF-8')
if mode in [None, "text"]:
text = jinja2.escape(text)
- lines = [unicode(line) for line in text.splitlines()]
+ lines = text.splitlines()
except UnicodeDecodeError:
if path_in_tar:
handle.seek(0) Although this enforces try:
...
lines = [unicode(line) for line in text.splitlines()]
...
except UnicodeDecodeError:
try:
text = unicode(text, 'UTF-8')
if mode in [None, 'text'];
text = jinja2.escape(text)
lines = text.splitlines()
except UnicodeDecodeError:
if path_in_tar:
handle.seek(0)
... To avoid breaking compatibility with any exotic encodings that Cylc Review might currently handle by accident. |
* Assume UTF-8. * Replace any unknown characters to avoid errors. * Closes cylc#6171
Currently Cylc Review cannot handle many characters, including those used to create the Cylc logo on the command line. As a result any log file containing the Cylc Logo will be shown as plain text.
Reproducible Example
Navigate to Cylc Review (or start it with
cylc review start
if you don't have a site deployment)The job activity log for this task is correctly handled by Cylc Review - most of the other log files are displayed as raw text.
The text was updated successfully, but these errors were encountered: