Skip to content

Show the notice that a transcript was saved under another name in the window too, not only in the log file - #359

Merged
kaixxx merged 1 commit into
kaixxx:mainfrom
happyarts:fix/log-link-tag
Oct 5, 2026
Merged

kaixxx merged 1 commit into
kaixxx:mainfrom
happyarts:fix/log-link-tag

Conversation

@happyarts

Copy link
Copy Markdown
Contributor

When the transcript cannot be written under its name (it is open in Word, say), save_doc saves it under another name and logs that in red, with a link to the file:

self.logn(t('rescue_saving', file=job.transcript_file), 'error', link=f'file://{job.transcript_file}')

In the window this line never appeared. _append_log_text adds the link's tags to the given ones, tags + self.hyperlink.add(...), and the tag comes as the string 'error'. So 'error' + ['hyper', 'hyper-0'] raised a TypeError, which was caught and written to the log file instead: ERROR: Error updating log_textbox: can only concatenate str (not "list") to str. A job that finishes shows the new name again at the end. For a job that fails or is cancelled, this notice is the only place that says where its partial transcript went.

A single tag given as a string is now wrapped in a list before the link's tags are added. It is the only caller that combines a tag with a link; the others pass none, and those already worked.

tests/test_log_link.py logs a line with a link and the tag 'error', once as a string and once as a list. Both must reach the textbox with the tags ['error', 'hyper', 'hyper-0']. The string case fails on main. Checked with a real textbox too: the line gets all three tags and the link still opens.

One thing you may want to decide: the notice now appears, but in the link's blue, not in the error colour. Tk gives the tag created last priority, and hyper is created after error. self.log_textbox.tag_raise('error') after creating the HyperlinkManager would make it yellow and still underlined. I left that out, since it changes how links look next to error text.

This touches _append_log_text only and merges cleanly with #357, which changes log and logr nearby.

🤖 Generated with Claude Code

… window too, not only in the log file

When the transcript cannot be written under its name -- it is open in
Word, say -- save_doc saves it under another and logs that in red with
a link to the file. The window failed on it: the tag came as the
string 'error', and _append_log_text added the link's tags to it as a
list, so `'error' + ['hyper', 'hyper-0']` raised a TypeError, which was
caught and written to the log file instead. A job that finishes shows
the new name again at the end; for one that fails or is cancelled, this
notice is the only place that says where its partial transcript went.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kaixxx
kaixxx merged commit d7d308d into kaixxx:main Oct 5, 2026
3 checks passed
@happyarts
happyarts deleted the fix/log-link-tag branch October 5, 2026 11:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants