Skip to content

Fix UnicodeEncodeError in default log file handler (#385) - #386

Merged
brantfaircloth merged 5 commits into
mainfrom
fix/385-logfile-utf8-encoding
Aug 15, 2026
Merged

Fix UnicodeEncodeError in default log file handler (#385)#386
brantfaircloth merged 5 commits into
mainfrom
fix/385-logfile-utf8-encoding

Conversation

@brantfaircloth

Copy link
Copy Markdown
Member

Summary

  • setup_logging() in phyluce/log.py creates a FileHandler without encoding="utf8" when --log-path is not given, unlike the --log-path branch which does specify it.
  • phyluce_align_get_only_loci_with_min_taxa logs a message containing , which raised UnicodeEncodeError on systems whose default file encoding is ASCII (as reported in Error in 'phyluce_align_get_only_loci_with_min_taxa'? #385).
  • Adds encoding="utf8" to the default FileHandler so it matches the other branch.

Fixes #385

Test plan

  • Run phyluce_align_get_only_loci_with_min_taxa without --log-path on a system with a non-UTF-8 default locale and confirm no UnicodeEncodeError is raised.

@brantfaircloth
brantfaircloth merged commit f506c3e into main Aug 15, 2026
4 of 5 checks passed
@brantfaircloth
brantfaircloth deleted the fix/385-logfile-utf8-encoding branch August 15, 2026 21:33
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.

Error in 'phyluce_align_get_only_loci_with_min_taxa'?

1 participant